Jump to content

Help need with dates


smith.james0

Recommended Posts

I have the following code

$day1 = mktime (0,0,0,1,1,$year);
$days = ($week - 1) * 7;
$d = strtotime ("+$days days", $day1);
$dow = date('w', $d);
$sunday = strtotime ("-$dow days", $d);
$saturday = strtotime ("+6 days", $sunday);

 

to give me the timestamp on sunday and saturday for a given week and year. The problem I have is that it's giving it at 23.00 hours when i need it at 0.00 hours.

 

1179010800 translates to Saturday, May 12th 2007, 23:00:00 (GMT)

 

Can anyone see the problem?

 

Many Thanks James

Link to comment
https://forums.phpfreaks.com/topic/51280-help-need-with-dates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.