#43856 [Asn->Fbk]: mktime and strftime use different timezones

From: Date: Thu, 31 Jan 2008 20:36:27 +0000
Subject: #43856 [Asn->Fbk]: mktime and strftime use different timezones
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121843@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: Feedback Bug Type: Date/time related Operating System: Linux PHP Version: 5.2.5 Assigned To: derick New Comment: 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"; ?> Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#121843) next »