|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-02 11:50 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 14:00:01 2025 UTC |
Description: ------------ strptime() seems to have two problems. First is that it returns the month - 1 instead of the correct numerical month value. Second is that it returns "107" for the year instead of "2007" as it should. I tested this in the latest CVS snapshot also (php5.2-200709201630). Also, for years prior to 2000, it returns the two-digit year, e.g. 96 instead of 1996 when using the %Y format code, which is supposed to return the four-digit year. Reproduce code: --------------- <? $tmp = strptime("20/Sep/2007:11:51:15","%d/%b/%Y:%H:%M:%S"); var_dump($tmp); ?> Expected result: ---------------- array(9) { ["tm_sec"]=> int(15) ["tm_min"]=> int(51) ["tm_hour"]=> int(11) ["tm_mday"]=> int(20) ["tm_mon"]=> int(9) ["tm_year"]=> int(2007) ["tm_wday"]=> int(0) ["tm_yday"]=> int(0) ["unparsed"]=> string(0) "" } Actual result: -------------- array(9) { ["tm_sec"]=> int(15) ["tm_min"]=> int(51) ["tm_hour"]=> int(11) ["tm_mday"]=> int(20) ["tm_mon"]=> int(8) ["tm_year"]=> int(107) ["tm_wday"]=> int(0) ["tm_yday"]=> int(0) ["unparsed"]=> string(0) "" }