Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timelocal, by design, is not reliable at transition times #600

Closed
p5pRT opened this issue Sep 20, 1999 · 2 comments
Closed

timelocal, by design, is not reliable at transition times #600

p5pRT opened this issue Sep 20, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 20, 1999

Migrated from rt.perl.org#1459 (status was 'resolved')

Searchable as RT1459$

@p5pRT
Copy link
Author

p5pRT commented Sep 20, 1999

From The RT System itself

In fact timelocal accepts only 6 arguments. This works for most of the
date-times but not near the transition between daylight saving time and
normal time.

In the night when transition from normal to daylight saving time occurs,
the clock usually jumps from 02​:00 AM and 03​:00 AM. There is no 02​:15 AM
on that day, for example.

On the other hand, in the night when transition from DST to normal time
occurs, the clock backs from 03​:00 AM to 02​:00 AM. A date-time like
02​:15 AM occurs 2 times, once as a DST date-time hour and, one hour
later, as a normal date-time.

For these reasons, timelocal should accept a further argument that
specifies if the date-time specified by the other 6 arguments is a DST
date-time or not. Of course, this arguments is really needed only for
that special date-times that happen to occur 2 times during that single
night in a year. Other date-time values implicitly determine whether
they belong to the DST span or not, so the argument should be ignored.
The argument can be made optional for most date-times but needs to be
specified explicitely by the programmer for those special cases​: how can
he otherwise specify if on that special night 02​:15 AM is to be
interpreted as the 02​:15 AM before or after the transition?

Furthermore, to identify those special times, the API should be extended
by a function that returns whether a given date-time is one of those
special values that occur 0 or 2 times and another function that, given
a year, returns the 0 values span and the 2 values span in the current
timezone.

I hope the concern has been clearly expressed. Of course, I'm at your
disposal for questions.

Thanks
Raffaello Giulietti

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2003

@iabyn - Status changed from 'stalled' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant