Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same DAY, different day- mktime prob

Status
Not open for further replies.

roycrom

Programmer
Aug 2, 2002
184
GB
I am running PHP 4.3.4 on Solaris 9.

If i run this bit of code
Code:
<?
$TIME=mktime(0,0,0,03,29,2003);
$DATE=date("D", $TIME);
echo $DATE;
?>

It returns Sat.

However if I turn it to

Code:
<?
$TIME=mktime(0,0,0,03,30,2003);
$DATE=date("D", $TIME);
echo $DATE;
?>

it returns Sat too!! 31st returns Monday and 28th returns Friday so why is it getting 2 Sats for 29th and 30th and Not Sun for 30th??

I'm stumped. As I'm creating a calendar I start a new row after every Sat but this is screwing my nice neat Calendar up.

Please help.

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
Sorry for the post guys, aint it weird how you see something immediately after calling for help.

Anyway, I had to change the hour from midnight to 2 am as the clocks go back at this time so it was staying as saturday.

The reason I was stumped is that this didn't happen on my linux box. It must handle it differently.

Thanks if you were gonna reply anyway. :))

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top