You are here: strtotime time zone trouble « PHP « IT news, forums, messages
strtotime time zone trouble

Posted by Marcus Bointon on 01/18/05 12:06

How is this not a bug?

<?php
print date('Y-m-d H:i:s', strtotime('now UTC'))."\n";
print date('Y-m-d H:i:s', strtotime('now PST'))."\n";
?>

outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)

The time zone correction is applied in the wrong direction. Does it in
both current PHP 4 and 5.

Named time zones like these are supposedly deprecated, but the
suggested alternative in the docs doesn't work at all:

print date('Y-m-d H:i:s', strtotime('now UTC-0800'))."\n";

1970-01-01 00:59:59

using 08:00 doesn't work either

Ideas?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация