I’ve searched for something in libraries like Dates and AstroTime, but maybe missed it as I’m surprised not to find it.
I would like to find the decimal time from a date, hour, minute, second, e.g.:
DateTime(2018,1,2,9,53,1) would give 2018.003828474404
This would be the reverse function from this thread:
Also, I need to take the leap second into account.
Aside from getting the year, which is in Dates module, getting the partial year can be done as follows (note the endless trickiness with dates requires care not to make bugs):
I think leap seconds are just not supported by Julia’s DateTimes. Probably on purpose? But idk.
There can be some packages that add leap seconds support to Julia.