How to get milliseconds now () in Julia 0.4-pre?

How to get milliseconds now ()?

Dates.format(now(), "HH:MM:SS.sss")

gives

"18:32:11.000"

where the part is .sssalways .000.

+4
source share
2 answers

now() does not record milliseconds:

julia> @show x=now(); @show Dates.millisecond(x); @show Dates.second(x)
x = now() = 2015-09-04T19:09:32
Dates.millisecond(x) = 0
Dates.second(x) = 32
32
+3
source

From your other question, I found your comment:

dt = Dates.unix2datetime(time())
Dates.millisecond(dt)

What makes a business. Greetings.

0
source

Source: https://habr.com/ru/post/1606013/


All Articles