Converting stat mtime to date


#1

it looks like mtime is in seconds or some fraction thereof and encoded as a Float64.

I’m trying to turn it into a date and haven’t had any luck finding a function to do that. The Dates module functions all work on an Int.

Any ideas ?

Thanks,

p.s. i tried round(Int, mtime) but that doesn’t work, most likely because the underlying units are wrong.


#2

And the best way to find an answer is to post a question…

julia> Dates.unix2datetime(s.mtime)
2018-12-12T06:06:32.2

From the Julia wiki under Unix time. Using the right words when you search is key…