Jump to content

mktime adding +8 GMT


nathanblogs

Recommended Posts

Hi,

 

I am having an issue with mktime adding +8GMT(my local timezone) onto the timestamp it creates. I did a search of the forums and found this topic here http://www.phpfreaks.com/forums/index.php/topic,214501.0.html .

 

However setting date_default_timezone_set("Europe/Berlin"); doesn't work all it does is adds +7GMT onto the value.

 

This is the code I am using, basically I am trying to create a timestamp at the being of the day 00:00 and at the end of the day 23:59.

$time = mktime(0, 0, 0, $dateParts[1], $dateParts[0], $dateParts[2]);
$time = mktime(23, 59, 59, $dateParts[1], $dateParts[0], $dateParts[2]);

 

Thank you for any input.

 

Nathan

Link to comment
https://forums.phpfreaks.com/topic/133955-mktime-adding-8-gmt/
Share on other sites

I dont know all the names but would it hurt to change the zone to maybe Europe/Warsaw sore somewhere east of you by one timezone, I am sure there are some cities in africa that qualify too.

 

//berlin is 8 hours from gmt, wow, would never have guessed

Link to comment
https://forums.phpfreaks.com/topic/133955-mktime-adding-8-gmt/#findComment-697351
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.