https://kotlinlang.org logo
m

menegatti

11/29/2018, 1:51 PM
more specifically, is there a way to get the current system time, such as in
System.getCurrentTimeMillis()
?
c

cy

11/29/2018, 1:53 PM
Not yet. The only workaround for now is to use ktor's
GMTDate
kotlinx time is planned but not even started
m

menegatti

11/29/2018, 1:56 PM
makes sense, thanks 👍
t

thevery

11/29/2018, 2:05 PM
s

Sabrina Namur

11/29/2018, 2:06 PM
or you could use expect/actual because java and kotlin/native both have this method (I don't know if js has this method bc I don't use it)
a

addamsson

11/29/2018, 2:06 PM
Yea I'd go with the
expect
solution
e

einar

11/29/2018, 2:37 PM
m

menegatti

11/29/2018, 4:30 PM
thanks, that's very helpful
c

cy

11/29/2018, 4:33 PM
Well, it depends on what do you need but writing correct posix implementation is not that easy as write a single line of code
m

msink

11/29/2018, 5:19 PM
d

Dico

11/29/2018, 5:35 PM
Look in kotlin.system package, a multiplatform function like
System.currentTimeMillis()
exists for a start.
4 Views