Prev: codeblocks port?
Next: NYC LOCAL: Thursday 17 June 2010 UNIGROUP: Charles Milo on the Intel Server Processor Roadmap
From: KnowledgeSeaker on 15 Jun 2010 15:45 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 15 Jun 2010 22:34
>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). |