Bug #68871 [Opn]: strftime returns wrong timestamp with date_default_timezone_set

From: Date: Wed, 21 Jan 2015 10:35:40 +0000
Subject: Bug #68871 [Opn]: strftime returns wrong timestamp with date_default_timezone_set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190107@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68871&edit=1 ID: 68871 Updated by: ajf@php.net Reported by: ricky at ez2 dot us Summary: strftime returns wrong timestamp with date_default_timezone_set Status: Open Type: Bug -Package: PHP Language Specification +Package: Date/time related Operating System: Ubuntu 14.04 x64 PHP Version: 5.5.20 Block user comment: N Private report: N New Comment: This has nothing to do with the language specification. Please choose categories accurately. Previous Comments: ------------------------------------------------------------------------ [2015-01-21 08:04:39] ricky at ez2 dot us Description: ------------ strftime with %s format returns wrong value. Test script: --------------- <?php //php.ini date.timezone = Asia/Taipei (UTC +0800) date_default_timezone_set('UTC'); $time = time(); $time2 = strftime('%s', $time); if($time != $time2){ echo "something wrong"; } else{ echo "nothing"; } Expected result: ---------------- nothing Actual result: -------------- something wrong ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68871&edit=1

« previous php.bugs (#190107) next »