php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33682 The function localtime() don't work as expected
Submitted: 2005-07-13 20:29 UTC Modified: 2005-07-13 21:25 UTC
From: v1d4l0k4 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.4 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 - 20 = ?
Subscribe to this entry?

 
 [2005-07-13 20:29 UTC] v1d4l0k4 at gmail dot com
Description:
------------
The function localtime() don't work as expected. In the manual says that the key associative tm_year shows the year since 1900.

But, if year is higher than 2000, this key associative represents the year - 1900, or either, a hundred and few.

Reproduce code:
---------------
<?

print_r(localtime());

?>

Expected result:
----------------
I expect that the key associative tm_year represents 2005, no 105.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-13 20:57 UTC] derick@php.net
How much is 2005 - 1900? Exactly, 105. There is no bug here and the manual clearly describes that it's year - 1900.
 [2005-07-13 21:25 UTC] v1d4l0k4 at gmail dot com
Oh !

Excuse-me then ... I'm Brazilian and I check the pt-BR manual. In our language of manual, this don't be explicity, only cite that tm_year is since 1900, don't have examples ... what takes them tm_year is higher than 1900 ...

Anyway, very thanks for you ! ;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 07:01:30 2024 UTC