Aug
17
Filed under: Asides | August 17th, 2004

Leap seconds

Dealing with leap seconds, I remember the days when 60 * 60 * 24 was good enough for anyone.

No related posts.

3 Responses

  • ramin | August 18th, 2004 @ 1:44 am | Reply

    Correct me if I’m wrong, but isn’t using strtotime() a safe way to do it? I only use $date = date('Y-m-d', strtotime('+1 day', strtotime($date))); in my own code for date increments. At least this way I delegate the responsibility ;) .

  • Keith | August 18th, 2004 @ 3:00 pm | Reply

    Excellent. Yes, strtotime() should be enough. I didn’t realize it let you do increments. Thanks ramin!

    One of the things I’ve been wondering is what numeric value you get when you have a fall daylight savings time (where your time gets set back an hour). In that case, you’ll have two times that are the same time (i.e. two 1:30am’s). Each has a unique reference point in UTC, but strtotime has to arbitrarily pick one when you ask for a timestamp in that limbo period.

  • Anonymous | September 7th, 2004 @ 5:12 pm | Reply

    What about spring? On the day the shift to daylight time occurs, there is no 2:30 am. What should/does it do when given the previous date with that time and asked to increment one day?

Share your thoughts