php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47277 strptime() returns invalid value for %y
Submitted: 2009-02-02 11:27 UTC Modified: 2009-02-02 14:19 UTC
From: stsung at mail dot ru Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.8 OS: CentOS 5.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stsung at mail dot ru
New email:
PHP Version: OS:

 

 [2009-02-02 11:27 UTC] stsung at mail dot ru
Description:
------------
When strptime() is used with %y in format, it returns an invalid Year in tm_year. 

Reproduce code:
---------------
$test = strptime('02-Feb-09 11:16:00', '%d-%b-%y %H:%M:%S');
echo $test['tm_year'];

Expected result:
----------------
2009

Actual result:
--------------
109

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-02 14:19 UTC] johannes@php.net
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

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 14:01:31 2025 UTC