# Even after dt = trunc(dt,Second); I am still seeing divexact errors...
On Friday, January 29, 2016 at 12:44:35 PM UTC-8, Michael Landis wrote: > > Is there a language convention for converting/comparing unix timestamps > (e.g. file modify dates) and DateTimes? > > When I do: > fs = stat( "X.csv" ); > ms = now() - fs.mtime; > typeof(ms) --> Base.Dates.Millisecond, even though now() is a DateTime > > # you would think that creating a DateTime, would make them comparable, but > dt = DateTime( fs.mtime ); > # still has fractional seconds in it, so computations with dt and > constructed DateTimes produce divexact errors > > What's the best stylistic workaround for that? > > >