php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13331 bad results of "getdate()" function
Submitted: 2001-09-16 15:17 UTC Modified: 2001-09-16 17:26 UTC
From: miran at centrum dot cz Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.0.6 OS: win2k
Private report: No CVE-ID: None
 [2001-09-16 15:17 UTC] miran at centrum dot cz
Hi,
  I found some bug in function getdate() - it returns bad results - from two different times (1035680400 and 1035676800) returns function "getdate(int fromTime)" same results, but it shouldn't (of course) 
:(

try this piece of code:

<?
	$date_one = getdate(1035680400);
	echo "1035680400 =>";
	print_r($date_one);

	echo "<br>1035676800 =>";
	$date_two = getdate(1035676800);
	print_r($date_two);
?>

it products this output:

1035680400 =>Array ( [seconds] => 0 [minutes] => 0 [hours] => 2 [mday] => 27 [wday] => 0 [mon] => 10 [year] => 2002 [yday] => 299 [weekday] => Sunday [month] => October [0] => 1035680400 ) 
1035676800 =>Array ( [seconds] => 0 [minutes] => 0 [hours] => 2 [mday] => 27 [wday] => 0 [mon] => 10 [year] => 2002 [yday] => 299 [weekday] => Sunday [month] => October [0] => 1035676800 ) 

I don't know how is it with other dates, bud I think, that this bad result is not the only one - I maked some web application, which operates with dates and this problem was there more times ...

good luck

miran

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-16 15:48 UTC] hholzgra@php.net
ever heard of daylight saving time? :)
 [2001-09-16 16:33 UTC] derick@php.net
You just discovered daylight savings time...

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC