Bug #71369 [Opn->Nab]: strftime
Edit report at https://bugs.php.net/bug.php?id=71369&edit=1
ID: 71369
Updated by: requinix@php.net
Reported by: info at jdv dot ch
Summary: strftime
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: centOS 6
PHP Version: Irrelevant
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
http://php.net/strftime
%g is the ISO-8601:1988 year number. Not the normal year number. Try %y instead.
Previous Comments:
------------------------------------------------------------------------
[2016-01-14 15:05:44] info at jdv dot ch
Description:
------------
for($i=12;$i>=0;$i--){
$dt = mktime(0, 0, 0, date("m")-$i, '1', date("Y"));
$mois[] = date('M-y',$dt) .';'.
utf8_encode(strftime("%h %g",$dt)) .';'.
$dt;
}
var_dump($mois);
Test script:
---------------
Today january 2016 the last 2 lines are:
array(3) { [0]=> string(6) "Dec-15" [1]=> string(8) "déc. 15" [2]=>
string(10) "1448924400" }
array(3) { [0]=> string(6) "Jan-16" [1]=> string(8) "janv. 15" [2]=>
string(10) "1451602800" }
See [1] of the last line... why janv. 15 and not janv. 16 ??
Expected result:
----------------
array(3) { [0]=> string(6) "Jan-16" [1]=> string(8) "janv. 16" [2]=>
string(10) "1451602800" }
Actual result:
--------------
array(3) { [0]=> string(6) "Jan-16" [1]=> string(8) "janv. 15" [2]=>
string(10) "1451602800" }
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71369&edit=1
Thread (2 messages)