NYCPHP Meetup

NYPHP.org

[nycphp-talk] Date Calculation Error

Chris Bielanski Cbielanski at inta.org
Fri May 28 10:48:15 EDT 2004


Just so I can get a clearer picture, is there something evil about
installing Julian, or is it that it's not a "standard" package and therefore
just an annoyance?


Thanks,
Chris Bielanski
Web Programmer, 
International Trademark Association,
1133 Avenue of the Americas, 33rd Floor
New York, NY 10036
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org  
INTA -- 125 Years of Excellence



> -----Original Message-----
> From: David Sklar [mailto:sklar at sklar.com]
> Sent: Friday, May 28, 2004 10:40 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Date Calculation Error
> 
> 
> > 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.
> 
> Doing all your internal date math with GMT is a good idea. As long as 
> you don't use $timestamp += 86400 or $timestamp -=86400 for 
> incrementing 
>   or decrementing by 1 day, then you should be OK. 
> strtotime() is pretty 
> good about respecting DST changes. Depending on your system, though, 
> Julian days handle a wider range of dates than epoch timestamps.
> 
> David
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 



More information about the talk mailing list