I am using dynamic type to access KotlinJS Date javascript functions like getTimezoneOffset. The method return value is dynamic type. How to convert that to Long for example in efficient manner? dynamicDate.getTimezoneOffset().toString().toLong() is not optimal maybe?
k
konsoletyper
07/27/2017, 6:59 PM
1.
x.unsafeCast<Y>()
2.
val r: Y = x
i
ilya.gorbunov
07/27/2017, 9:54 PM
@konsoletyper Neither of these will return a correct
Long
!
ilya.gorbunov
07/27/2017, 9:59 PM
@tlaukkan However since timezoneoffset is a small number, and it fits in Int, you can use the proposed approach to get