Converting stat mtime to date

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 ?


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

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

julia> Dates.unix2datetime(s.mtime)

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

1 Like