Closed 97jaz closed 9 years ago
Actually, no, this isn't so simple.
The purpose of using ->datetime/utc
is to use the same offset for both arguments to days-between
. You should be able to find the days between moments in different time zones, which means that days-between
can't be entirely tz-insensitive... which may be a bit of a problem.
Or maybe we should translate the second argument into the TZ of the first, then use the local datetimes? I'll need to see how this interacts with duration-between
. (Though if I need to choose between them, I'll drop the latter.)
It appears that java.time does what I suggested in the previous comment, viz., translates the second arguments into the same TZ as the first and then uses the local datetimes.
... following the convention that date arithmetic is not timezone-sensitive, whereas time arithmetic is.
Received the following in a bug report:
Fix is straightforward, I think: days-between on datetime providers should use the JD of the local datetime values of its arguments, not the UTC datetime values.
moment->jd shouldn't be changed, though. This is peculiar to date arithmetic.