#43856 [Asn->Bgs]: mktime and strftime use different timezones
| From: | derick@php.net | Date: | Thu, 13 Mar 2008 16:01:24 +0000 |
| Subject: | #43856 [Asn->Bgs]: mktime and strftime use different timezones | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-123295@lists.php.net to get a copy of this message | ||
ID: 43856
Updated by: derick@php.net
Reported By: john at jcoppens dot com
-Status: Assigned
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux
PHP Version: 5.2.5
Assigned To: derick
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
You need to install the pecl/timezonedb extension.
Previous Comments:
------------------------------------------------------------------------
[2008-02-01 01:29:25] john at jcoppens dot com
That was a typo, it must be:
America/Argentina/Cordoba
John
------------------------------------------------------------------------
[2008-02-01 01:11:40] john at jcoppens dot com
Output of script:
PHP Strict Standards: date_default_timezone_get(): It is not safe to
rely on the system's timezone settings. Please use the date.timezone
setting, the TZ environment variable or the date_default_timezone_set()
function. In case you used any of those methods and you are still
getting this warning, you most likely misspelled the timezone
identifier. We selected 'America/Buenos_Aires' for 'ARST/-2.0/DST'
instead in /root/- on line 4
America/Buenos_Aires
time() = 1201827963
strftime = PHP Strict Standards: strftime(): It is not safe to rely on
the system's timezone settings. Please use the date.timezone setting,
the TZ environment variable or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'America/Buenos_Aires' for 'ARST/-2.0/DST' instead in /root/- on line 9
PHP Strict Standards: mktime(): It is not safe to rely on the system's
timezone settings. Please use the date.timezone setting, the TZ
environment variable or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'America/Buenos_Aires' for 'ARST/-2.0/DST' instead in /root/- on line 9
23:06:03 ARST -0200
GMT offset = 10800
Do note that I have updated the zoneinfo of the system, and the
way to define the time zone is now
Amertica/Argentina/Cordoba
I noticed that is some systems the Argentina directory was added,
but the old BuenosAires etc files were not removed in the
America level (BuenosAires, Cordoba, Jujuy, SanJuan, and a couple
others.
John
------------------------------------------------------------------------
[2008-01-31 20:36:27] derick@php.net
What's the output of this script:
<?php
error_reporting( E_ALL | E_STRICT );
echo date_default_timezone_get(), "\n";
echo "time() = " . time() .
" \nstrftime = ", strftime("%T %Z %z") .
" \nGMT offset = " . mktime(0, 0, 0, 1, 1, 1970) .
"\n";
?>
------------------------------------------------------------------------
[2008-01-15 15:17:14] john at jcoppens dot com
Description:
------------
mktime() and strftime use different timezones...
Reproduce code:
---------------
echo "time() = " . time() .
" \nstrftime = ", strftime("%T %Z %z") .
" \nGMT offset = " . mktime(0, 0, 0, 1, 1, 1970) .
"\n";;
Expected result:
----------------
time() = 1200409896
strftime = 13:11:36 ARST -0200
GMT offset = 7200
Actual result:
--------------
time() = 1200409896
strftime = 13:11:36 ARST -0200
GMT offset = 10800
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43856&edit=1