Bug #71369 [NEW]: strftime

From: Date: Thu, 14 Jan 2016 15:05:46 +0000
Subject: Bug #71369 [NEW]: strftime
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198648@lists.php.net to get a copy of this message
From:             info at jdv dot ch
Operating system: centOS 6
PHP version:      Irrelevant
Package:          Date/time related
Bug Type:         Bug
Bug description:strftime

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 bug report at https://bugs.php.net/bug.php?id=71369&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71369&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71369&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71369&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71369&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71369&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71369&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71369&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71369&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71369&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71369&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71369&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71369&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71369&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71369&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71369&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71369&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71369&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71369&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71369&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71369&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#198648) next »