-
Notifications
You must be signed in to change notification settings - Fork 9
Implicit local timezone assumed in Epoch #26
Comments
It's not the |
This may be a matter of perspective, but I'm not particularly convinced yet. I think it comes down to the definition of that 10 digit number. In both Java and Unix, it is defined as number of seconds since 1-1-1970 00:00:00 GMT. Not that the epoch is defined as GMT, not local time. Defining the epoch at GMT ensures that each instance in time, at any place on earth, can be described by the same number (modulo relativistic effects, or leap seconds). If you define epoch based on local time, then that number does not define an instance in time, you need a number and a location. Hence I think I think the inconsistency is best illustrated by the following invocation. I would expect that
Having written all that however, I am not sure if full consistency is possible without the full TZ db. PS: FWIW, the java |
I think I'm with Avik on this one. I'm also not entirely convinced about
"naive time" in general.
|
@aviks, let me stress again, the confusion/problem is not in
I think your confusion comes from the fact that We really can't do any better with the current, minimal Base implementation. We could change My point about Java being timezone aware is the fact that when you ask for the current date, they're implicitly doing I guess that's another possible approach that may be less subtle for users. Really though, I should just finish up |
So I am currently in
British Summer Time
, which isGMT-1
ie, one hour ahead of GMT. At the time I did this, the local time was 52 minutes past 4 in the afternoon.It seems like the datetime2unix and unix2datetime functions in julia consider the epoch to be
1-1-1970 00:00:00 localtime
while both OSX and Java consider the epoch to be1-1-1970 00:00:00 GMT
. This causes issues when converting between the two. What would you think is the best way of handling this?I realise dates doesn't do full timezones at this time, I still think this assumption of local time in epoch is a bit suspect.
The text was updated successfully, but these errors were encountered: