NYCPHP Meetup

NYPHP.org

[nycphp-talk] Date Calculation Error

David Mintz dmintz at davidmintz.org
Fri May 28 09:49:26 EDT 2004



The next question is, what do you do about calculating real (not clock)
differences between two dates that straddle the time change?

I've looked at the recipe in the <fawn>justly legendary</fawn> PHP
Cookbook. It involves converting to Julian day. I came across it
belatedly, after I'd rolled my own solution that converts the input dates
to GMT and then does the arithmetic. It appears to work with every case
I've thrown at it; I've tested the hell out of it. Still I wonder if you
guys think the strategy is sound.

One thing I like about my solution is that it doesn't require any
extensions to be loaded.

---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list