Re: timezone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 15, 2013 at 1:59 PM, Lester Caine <lester@xxxxxxxxxxx> wrote:
> Larry Martell wrote:
>>>
>>> No, I don't - this app runs in different locations all over the world.
>>
>> I found some code at php.net that does this:
>>
>> date_default_timezone_set(@date_default_timezone_get());
>> $deftz = date('T');
>>
>> And that is working for me and giving me what I need.
>
>
> But do you ACTUALLY know what time zone is stored IN the database? What if
> te database was from another server?
>
> One of the 'standards' adopted when working world wide is to ensure what is
> stored IN the database is always UTC based. So you can always compare times
> on the same consistent base. The only time you need the offset is to display
> a local time, and that is either the time local to the server, or the time
> local to the client.
>
> The 'default' timezone is not necessarily the right one in either case ;)

I misspoke - the data in the db is in UTC. This is used to covert the
time of day on the server to the user's local timezone.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux