Hi,
as I understand, in Julia we have Date (with 1d resolution, and an “epoch” of Rata Dei 0001-01-01 with the good old proleptic Gregorian calendar), DateTime (with 1 ms resolution, and the same “epoch”, able to cover +/-200 m years), as well as Time (with 1 ns resolution).
I’m looking for a DateTime or TimeStamp with a bit higher resolution.
It would appear that there are two options (while staying within an Int64):
- something with microsecond resolution, centred at the same epoch, with +/- 200k years
- something with nanosecond resolution, covering only +/- 200 years, thus should probably be centred around some other epoch, e.g. the 1970 UNIX one.
(It appears that Python has a datetime with 1µs resolution, as in 1., while numpy’s datetime64 allows you to select the unit, so you could have a 1 ns resolution.)
How easy would it be to instantiate and work with a Julia DateTime with a different resolution? How much is everything predicated on the immutable UTInstant in UTMillisecond? Are there any users/libraries doing this?
(For background, I’m trying to convince a team I’m working with to consider Julia instead of Python, and tried to code something up quickly to demonstrate how easy it is, and basically stumbled at the first opportunity, trying to parse "2017-05-03 09:00:00.007935” (note date and time with micro second resolution)… :-/ )
I’d hope implementing a useful TimeStamp based on UTMicrosecond should be not too hard, though it’s unclear to me how it fits into the whole infrastructure (particularly the fancy new parser is somewhat hard to read).
A TimeStamp based on UTNanosecond would have to have a different epoch to be useful, so that would be somewhat harder.
Thanks,
Fab
PS: There was this related thread, but that’s been a long time ago…
https://groups.google.com/forum/#!searchin/julia-users/datetime$20resolution|sort:relevance/julia-users/R25Mz7nWo7o/0nLMlSqAsuYJ