3 ms·
Most of what you want sounds like DateTime and TimeSpan from .net. However Joda does a lot more, like taking into account the various historical, political cha
by barrkel 13y ago
Most of what you want sounds like DateTime and TimeSpan from .net.
However Joda does a lot more, like taking into account the various historical, political changes in time zone, and the distinction between a duration between two human-understandable semantic times, versus a duration as a fixed span of time.
- bane 13y agoI'm probably looking at the issue too simply, but shouldn't all that be abstracted away into the library, with maybe some notes on particularly weird cases? I'm also not sure I understand the distinction between the two durations, if I set a startDate object up on the Islamic Tabular Fatimid calendar and say it's year 14 and endDate is some pre-reformation Julian calendar and say it's year 231, shouldn't the Duration class be able to figure out a fixed span of time from that? I really could care less how it does it, just that the right number of years, months and days fall out of it. Or if I just want to create the object with some defined span, they're the same thing.
- kbolino 13y agoGiven a date, how do you obtain a new date equal to the same month and day of month in the following year? You can't do that consistently with a duration measured in milliseconds or nanoseconds. Instead, you need a more abstract representation of time, something akin to "increment only the year field of a date". That's what Periods are for.