|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-30 07:26 UTC] sanjay dot mantoor at gmail dot com
[2009-05-03 15:12 UTC] derick@php.net
[2009-05-11 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 22:00:01 2025 UTC |
Description: ------------ getdate function returns wrong "weekday" for higher negative timestamps like -12.3456789000e10. This is observed on linux 64 bit with both php5.2 and php5.3 release. As per documentation "weekday" should be "Sunday through Saturday". But in this case it returns "Unknown" value. Checked with php version PHP 5.3.0alpha3-dev (cli) (built: Oct 29 2008 15:20:01) Reproduce code: --------------- <?php $timestamp=-12.3456789000e10; var_dump( getdate($timestamp) ); ?> Expected result: ---------------- array(11) { ["seconds"]=> int(20) ["minutes"]=> int(23) ["hours"]=> int(5) ["mday"]=> int(23) ["wday"]=> int(-4) ["mon"]=> int(10) ["year"]=> int(-1943) ["yday"]=> int(295) ["weekday"]=> string(7) "Monday" ["month"]=> string(7) "October" [0]=> int(-123456789000) } Actual result: -------------- array(11) { ["seconds"]=> int(20) ["minutes"]=> int(23) ["hours"]=> int(5) ["mday"]=> int(23) ["wday"]=> int(-4) ["mon"]=> int(10) ["year"]=> int(-1943) ["yday"]=> int(295) ["weekday"]=> string(7) "Unknown" ["month"]=> string(7) "October" [0]=> int(-123456789000) }