You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
# convert Float64 value into DateTime object
function datetime_from_float(x::Vector{Float64})
v = Vector{Union{DateTime, Missing}}(length(x))
for i in 1:length(x)
v[i] = isnan(x[i]) ? missing : (sas_datetime_origin + Dates.Second(round(Int64, x[i])))
end
v
end
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: