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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 19:01:30 2024 UTC