Re: Date handling.
From: Russ Allbery <hidden>
Date: 2016-06-15 22:41:54
David Woodhouse [off-list ref] writes:
I don't think we want to be in the business of counting leap seconds; we need to let the system do it. I don't much like setting TZ to UTC though -- how about we use your test case to find the offset and subtract that?
Does this work?
Nope, daylight savings time breaks this, since you may or may not be in the same time zone on January 1st as you are at the current time. However, you don't need to count leap seconds when you implement your own mktime, since mktime doesn't have to take leap seconds into account. Unix timestamps, unless you're using TAI, don't include leap seconds. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>