Reply to Re: Time help

Your name:

Reply:


Posted by David Haynes on 07/07/06 11:50

Hoopster wrote:
> I'm creating a script to include time.
>
>
> Here is my code.
>
> <?php
> echo date("H:i:s");
> ?>
>
>
> However, my server is 2 hours difference from me. What is the exact
> command that I can use to offset it.
>
>
> Please provide me with an exact code change as I'm new at this.
>
>
> Thanks

As others have pointed out, you could just add 2 hours (in seconds) to
the offset but what about daylight saving time?

A better way is to set the timezone value.
e.g.

// save the current timezone
$my_tz = date_default_timezone_get();
// set the new timezone
date_default_timezone_set('America/New York');
// display the time and timezone
echo date('H:i:s T');

-david-

[Back to original 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

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