Jump to content

Timezones


mentalist

Recommended Posts

What is the best method for managing timezones?

 

Is there a PHP function for retrieving a list of? or should I build a list from the data contained in this download ftp://ftp.iana.org/tz/releases/tzdata2014b.tar.gz from this page http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

 

On php.net I only seem to be able to find how to list the regions and countries but not the offsets, e.g.

 

$timezone_identifiers = DateTimeZone::listIdentifiers();
for ($i=0; $i < 5; $i++) {
echo "$timezone_identifiers[$i]\n";
}

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/295765-timezones/
Share on other sites

 

http://php.net/manual/en/class.datetimezone.php

 

That's not to say it's easy to deal with time zones - in my experience, it's kind of a massive pain in the butt. However, using DateTime and DateTimezone objects does make it a better experience.

 

 

I was going cyclic looking through that part of the manual, really wasn't too much help.

 

But just found this and is the first example I've tried which didn't produce exceptions :D

 

http://www.pontikis.net/tip/?id=24

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/295765-timezones/#findComment-1509634
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.