Bug #68758 [Opn->Nab]: strftime give wrong year if new year begins in the same week.

From: Date: Tue, 06 Jan 2015 11:59:29 +0000
Subject: Bug #68758 [Opn->Nab]: strftime give wrong year if new year begins in the same week.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189682@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68758&edit=1 ID: 68758 Updated by: derick@php.net Reported by: gareth at venditor dot com Summary: strftime give wrong year if new year begins in the same week. -Status: Open +Status: Not a bug Type: Bug Package: Date/time related Operating System: Linux/OS-X etc PHP Version: 5.5.20 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php %G is the "year of the ISO week number". December 30 is in week 1 of ISO year 2015. You want %Y. Previous Comments: ------------------------------------------------------------------------ [2015-01-06 11:10:42] gareth at venditor dot com Description: ------------ If you run strftime() on a date in the last week of a year (e.g. 30 December 2014), and the new year begins in the same week, the outputted date is "30 Dec 2015". Test script: --------------- <?php $tmpTime = 1419937605; // 30 Dec 2014 var_dump(strftime('%e %b %G (%a)', $tmpTime)); Expected result: ---------------- string(17) "30 Dec 2014 (Tue)" Actual result: -------------- string(17) "30 Dec 2015 (Tue)" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68758&edit=1

« previous php.bugs (#189682) next »