Does anyone know how to instantiate a Javascript Date using Kotlin?


As this class: has no constructor arguments...




Hi, Jørund

Please file issue to the tracker.

As workaround You can write own native declaration with missed constructors and feel free to contibute :).


Additionally, You can use "magic" function js and write something like:

val d: Date = js("new Date(2015, 11, 11)") println(d)



@native(“new Date”)
public fun jsDate(time:Long): Date = kotlin.js.Date();