I wasn't sure if mktime(0,0,0,1,32,2001) would work.
BUT!!! I stand corrected. you are absolutely right. PHP is smart enough to
know that January 32nd is really February first. :)
Next Time I'll test the code before i respond.
Johnny Nguyen
-----Original Message-----
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 03, 2001 8:33 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php date bug ?
as far as i know adding 1 day to the day value of the timestamp will
increment the month as well.
adding i day to july 31st will give august 1st.
if you need it i'll send you my code whihc now works.
i think gmmktime() would also have worked.
Steve
"Johnny Nguyen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm in the exact same position. It's definitely not a PHP problem.
>
> The problem with the way you're redefining your timestamp is that you may
> get January 32, June 31st, etc.
>
> I'm tempted to simply check for spring-forward and fallback before I
advance
> the timestep, but that's one extra if statement as much as 31 times in one
> month. 1000 people generating the calendar would create 31000 extra if
> statements, unless I get a Cache solution. There should definitely be a
PHP
> function for getNextDay(), but until then, I'm going to use the extra if
> statement.
>
> regards,
> Johnny Nguyen
>
> -----Original Message-----
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 03, 2001 7:56 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php date bug ?
>
>
> hi,
>
> i've got a calendar and i produce a month sort of outlook / filofax view
> that shows the user's appointments for that month.
>
> the way i was building it was but defining ADAY in the following manner:
>
> define("ADAY", (60*60*24) );
>
> once i'd done evrything i needed to do i incremented the timestamp for the
> day by ADAY.
>
> all seemed ok but then one of the users pointed out that October 28th
> appeared twice and then month had 32 days in for this year.
>
> after a bit of head scratching we realised that the clocks go forward (any
> foreign readers please excuse the rediculous way the british time system
> works) and technicallay i guess october 24th has 25 hours. thus the time
was
> incremented to a stamp within the same day.
>
> redfining the stamp as
>
> $start3=mktime(0,0,0,$dayArray[mon],$dayArray[mday]+1,$dayArray[year]);
>
> does work however ?
>
> is it php or the server that's at fault ?
>
> Steve
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]