Convert time interval to seconds?

T0 = now()
T = now() - T0

If I want to convert to seconds, I can do

convert(Float64, (now() - T0).value)/1000

Well, that’s ugly, and depends on knowing that the time period happens to be milliseconds. Is there a better way?


Perhaps tosecond{T}(t::T) = t / convert(T, Base.Dates.Second(1))?


Nice! Maybe should be included in DateTimes, or added to docs