[PHP] wrong time stamp in log filewrong time stamp in log file

2009-09-21 Thread Struzik Wojciech
I have updated a php to version 5.2.11. the timestamp in php log is
incorrect. the time differs from local time with 2 hours. In changelog
I can find the following information:
Updated timezone database to version 2009.13 (2009m) (Derick)
Is it related with my problem ???

When I run the following script:
?php
print date('d M Y, H:i');
?
It's returns a correct time.

I appreciate any help


RE: [PHP] wrong time stamp in log filewrong time stamp in log file

2009-09-21 Thread Andrea Giammarchi


 I have updated a php to version 5.2.11.
you should update the keyboard as well, it fires CTRL+V twice (subject, and I 
am joking ..)


 When I run the following script:
 ?php
 print date('d M Y, H:i');
 ?
 It's returns a correct time.

correct accordingly with your local time zone, 'cause I am pretty much sure 
that if you do
?php
print *gmdate*('d M Y, H:i');
?
the time will be exactly the same reported in the log file.

You would have known this if you were developing with E_STRICT since date is a 
warning, even in the phpinfo, if you do not set it correctly.

It's a good idea in any case, for obvious portability reasons across websites, 
countries, and hosts, to use gmdate for time operations, otherwise if I use 
date I could have stuff from the future in another host, and stuff from past in 
another one.

Regards

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx

Re: [PHP] wrong time stamp in log filewrong time stamp in log file

2009-09-21 Thread Tommy Pham
- Original Message 
 From: Andrea Giammarchi an_...@hotmail.com
 To: bm9ib...@gmail.com; php-general@lists.php.net
 Sent: Monday, September 21, 2009 11:41:01 AM
 Subject: RE: [PHP] wrong time stamp in log filewrong time stamp in log file
 
 
 
  I have updated a php to version 5.2.11.
 you should update the keyboard as well, it fires CTRL+V twice (subject, and I 
 am 
 joking ..)
 
 
  When I run the following script:
print date('d M Y, H:i');
  ?
  It's returns a correct time.
 
 correct accordingly with your local time zone, 'cause I am pretty much sure 
 that 
 if you do
  print *gmdate*('d M Y, H:i');
 ?
 the time will be exactly the same reported in the log file.
 
 You would have known this if you were developing with E_STRICT since date is 
 a 
 warning, even in the phpinfo, if you do not set it correctly.
 
 It's a good idea in any case, for obvious portability reasons across 
 websites, 
 countries, and hosts, to use gmdate for time operations, otherwise if I use 
 date 
 I could have stuff from the future in another host, and stuff from past in 
 another one.
 
 Regards
 
 _
 Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
 
 http://www.microsoft.com/windows/windowslive/products/photos.aspx

Did you set 'Default timezone' in php.ini or use the function 
date_default_timezone_set() in your app?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php