PHP timezone functions missing

Issues related to software problems.
Post Reply
funditech
Posts: 1
Joined: 2008/07/03 17:59:41
Location: Dallas
Contact:

PHP timezone functions missing

Post by funditech » 2008/07/03 18:09:30

I'm developing a large application in PHP in which I need to get a list of timezones. I went to the PHP site to find the right functions to use
(here: http://us2.php.net/manual/en/ref.datetime.php)

and discovered timezone_abbreviations_list() which would do exactly what I need. (documentation here: http://us2.php.net/manual/en/function.timezone-abbreviations-list.php)

Unfortunately it seems that even though the documentation says it should be in PHP 5.1.0, this function doesn't seem to exist on the CentoOS machines I have running.

php -version says:
PHP 5.1.6 (cli) (built: Sep 20 2007 10:16:10)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

so I'd think it should be there.

I'm worried this is a bug in the documentation for PHP but I'm hoping that there's just a package I'm missing or some other way to get this to work. Google was of little help so I'm asking here.

Thanks in advance!

(BTW I apologize if this is posted in the wrong spot. Wasn't sure if PHP would go with webhosts, services or applications :) )

azca
Posts: 174
Joined: 2006/06/03 18:06:13
Location: Peoria, AZ USA

PHP timezone functions missing

Post by azca » 2008/07/03 20:29:19

I'm afraid that this will not be of any help to you other to confirm that I, and apparently others, have run into a similar problem.

When I ran the example script at:

http://us2.php.net/manual/en/function.timezone-abbreviations-list.php

I got the following error in my /var/log/httpd/error_log:

[code]
...[error] [client 192.168.1.100] PHP Fatal error: Class 'DateTimeZone' not found in...
[/code]
Just as a swag I installed 'php-pear-Date', and restarted httpd, but the same error occurred.

And here is a discussion of others who have run into the problem:

http://www.hastymail.org/forums/Hastymail_2/645/

Sorry I couldn't have been of more help on this.

Post Reply