bug on date

Problems with the Windows version of XAMPP, questions, comments, and anything related.

bug on date

Postby rontoil » 11. December 2009 04:34

plz help...
bug date on XAMPP 1.7.2

Code: Select all
echo (strtotime("2009-03-30")-strtotime("2009-03-29"))/86400;

result : 0.95833333333333 ---> correct value : 1

Code: Select all
echo strtotime("2009-03-29");

result : 1238259600 ---> is correct

Code: Select all
echo strtotime("2009-03-30");

result : 1238342400 ---> correct value : 1238346000

1238342400-1238259600 =82800 ---> correct value : 86400
rontoil
 
Posts: 2
Joined: 11. December 2009 04:23

Re: bug on date

Postby Altrea » 11. December 2009 10:41

http://bugs.php.net/bug.php?id=27780

in other words:
strtotime uses the relative timezone (be careful to use it on summer-/wintertime change).

You can solve this problem by adding an timezone:

Code: Select all
echo (strtotime("2009-03-30 UTC")-strtotime("2009-03-29 UTC"))/86400;
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: bug on date

Postby rontoil » 16. December 2009 05:55

Altrea wrote:http://bugs.php.net/bug.php?id=27780

in other words:
strtotime uses the relative timezone (be careful to use it on summer-/wintertime change).

You can solve this problem by adding an timezone:

Code: Select all
echo (strtotime("2009-03-30 UTC")-strtotime("2009-03-29 UTC"))/86400;



is work...!!!
thx b4
rontoil
 
Posts: 2
Joined: 11. December 2009 04:23

Re: bug on date

Postby Altrea » 16. December 2009 06:03

You're welcome :wink:
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 106 guests