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 best solutions below

2
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
On

Alternatively, you can try:

System.currentTimeMillis()