Open tk3369 opened 6 years ago
Following up on this, I made a function that helped me, maybe it could be useful here. It only covers the case of Time
columns (not DateTime
)
seconds2time(t) = Time(Nanosecond(round(t,digits=9) * 1e9))
julia> seconds2time(34200)
09:30:00
julia> seconds2time(34200.0356466666)
09:30:00.035646667
I explicitly round it to nanoseconds because that is the smallest unit that the Dates.jl standard library supports. This is likely sufficient for most usage, I'd guess.
This code could be improved as x[i] is a floating point value of # of seconds since epoch. By multiplying it by 1e3 or 1e6 would allow us to read the data as in millisecond/microseconds. Need to cross check what precision SAS can support.