View Single Post

  #2 (permalink)  
Old 03-10-2008
CptDondo
 
Posts: n/a
Default Re: timezones and time display

On Sun, 09 Mar 2008 22:19:31 -0500, Jerry Stuckle wrote:

> CptDondo wrote:
>> I have a very basic shell script that I would like to include on my
>> webpage, so I'd like to translate it to php:
>>
>> #!/bin/sh
>> LANG=ja_JP.UTF-8 TZ=JST-9 date
>> LANG=cs_CZ.UTF-8 TZ=MET-1METDST date
>> LANG=en_US.UTF-8 TZ=PST3PDT date
>>
>> In short, it displays the date and time for a region in that region's
>> language and default format.
>>
>> I've been poking around php but I can't find where to set the
>> equivalent of TZ and LANG for the date() function...
>>
>>

> These are set with the date.timezone PHP configuration parameter. The
> default is in your php.ini file; you can change it with ini_set(), i.e.
>
>



so...

ini_set('date.timezone', 'PST3PDT');
echo date();
ini_set('date.timezone', 'MET-1METDST');
echo date();

or would that make something blow a gasket?

What about
date_timezone_set()
I can't find any usage examples....

--Yan
Reply With Quote