Scala get current-time millis with nscala-time

43.7k views Asked by At

I am trying to get the current time in millis doing this

DateTime.now.millis

but I get

Property[millisOfSecond]

Which is the way to get the current time in millis with nscala-time?

I want to do this, using the same library

2

There are 2 answers

2
agusgambina On BEST ANSWER

My bad, it was

DateTime.now(DateTimeZone.UTC).getMillis()

I leave the answer just in case is useful for someone else.

2
Sean On

Alternatively, you can try:

System.currentTimeMillis()