# Converting stat mtime to date

**URL:** <https://discourse.julialang.org/t/converting-stat-mtime-to-date/18605>\
**Category:** General Usage\
**Created:** [December 12, 2018, 6:09pm UTC](https://discourse.julialang.org/t/converting-stat-mtime-to-date/18605 "2018-12-12T18:09:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [December 12, 2018, 6:09pm UTC](https://discourse.julialang.org/t/converting-stat-mtime-to-date/18605/1 "2018-12-12T18:09:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [December 12, 2018, 6:12pm UTC](https://discourse.julialang.org/t/converting-stat-mtime-to-date/18605/2 "2018-12-12T18:12:58Z")

</div>

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…
