From: KnowledgeSeaker on
Hello,

For web sites using PHP and the now() function using the time on the
server what would be the best way to input the correct time for a
specific country knowing that the time on server is different?

Would ntp (or other solution) be a solution? we have a server with
several web sites runing in defferent time zone now and we must change
the php now() function to get the right time for each web sites.

Thanks for any solutions!
MAP
From: Gordon Burditt on
>For web sites using PHP and the now() function using the time on the
>server what would be the best way to input the correct time for a
>specific country knowing that the time on server is different?

time() or now() should return the same thing (time in GMT) regardless
of time zone. Functions such as localtime() will convert the time
to broken-down human form (year, month, day, hour, minute, second)
based on the time zone.

>Would ntp (or other solution) be a solution? we have a server with

NTP does GMT only.

>several web sites runing in defferent time zone now and we must change
>the php now() function to get the right time for each web sites.

Look at the PHP function date_default_timezone_set() (PHP 5.1.0 or
greater). You probably don't want the php.ini directive date.timezone
unless you have a different php.ini file for each virtual web site
(although it will set a PHP default different from the server
default).