Re: [PHP] Timezone and DST

2006-01-06 Thread M

Mark Steudel wrote:

Hi All,
 
I've got a little problem where our servers are in PST but the customer

operates in Hawaii (-10 GMT). I believe I can just get the time for them by
doing something like
 
date(d H i, strtotime('now -2 hours') );
 
But here's the catch, how should I deal with day light savings ( DST) . In

hawaii they don't observer DST, but in Washington State we do.
 
We're on php 4.x so I can't use the  date_default_timezone_set

http://us2.php.net/manual/en/function.date-default-timezone-set.php  that
was added in PHP 5
 
Thanks, Mark




set TZ enviroment variable, it should point to a file containing 
timezone information for Hawaii, for example:


putenv('TZ=/usr/share/zoneinfo/US/Hawaii');

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



Re: [PHP] Timezone and DST

2006-01-05 Thread Mike Tuller
Are you just displaying the time, or is this for submission in a  
database?



On Jan 5, 2006, at 12:50 PM, Mark Steudel wrote:


Hi All,

I've got a little problem where our servers are in PST but the  
customer
operates in Hawaii (-10 GMT). I believe I can just get the time for  
them by

doing something like

date(d H i, strtotime('now -2 hours') );

But here's the catch, how should I deal with day light savings  
( DST) . In

hawaii they don't observer DST, but in Washington State we do.

We're on php 4.x so I can't use the  date_default_timezone_set
http://us2.php.net/manual/en/function.date-default-timezone- 
set.php  that

was added in PHP 5

Thanks, Mark

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




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



RE: [PHP] Timezone and DST

2006-01-05 Thread Mark Steudel
Im just using it to set defaults on a QuickForm date element. 

-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 05, 2006 11:02 AM
To: Mark Steudel
Cc: php-general@lists.php.net
Subject: Re: [PHP] Timezone and DST

Are you just displaying the time, or is this for submission in a database?


On Jan 5, 2006, at 12:50 PM, Mark Steudel wrote:

 Hi All,

 I've got a little problem where our servers are in PST but the 
 customer operates in Hawaii (-10 GMT). I believe I can just get the 
 time for them by doing something like

 date(d H i, strtotime('now -2 hours') );

 But here's the catch, how should I deal with day light savings ( DST) 
 . In hawaii they don't observer DST, but in Washington State we do.

 We're on php 4.x so I can't use the  date_default_timezone_set
 http://us2.php.net/manual/en/function.date-default-timezone-
 set.php  that
 was added in PHP 5

 Thanks, Mark

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



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



Re: [PHP] Timezone and DST

2006-01-05 Thread Mike Tuller
I hate doing this, but you could use Javascript to use the date and time set
on the clients computer. You can't control how they have it set though.


On 1/5/06 1:13 PM, Mark Steudel [EMAIL PROTECTED] wrote:

 Im just using it to set defaults on a QuickForm date element.
 
 -Original Message-
 From: Mike Tuller [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 05, 2006 11:02 AM
 To: Mark Steudel
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Timezone and DST
 
 Are you just displaying the time, or is this for submission in a database?
 
 
 On Jan 5, 2006, at 12:50 PM, Mark Steudel wrote:
 
 Hi All,
 
 I've got a little problem where our servers are in PST but the
 customer operates in Hawaii (-10 GMT). I believe I can just get the
 time for them by doing something like
 
 date(d H i, strtotime('now -2 hours') );
 
 But here's the catch, how should I deal with day light savings ( DST)
 . In hawaii they don't observer DST, but in Washington State we do.
 
 We're on php 4.x so I can't use the  date_default_timezone_set
 http://us2.php.net/manual/en/function.date-default-timezone-
 set.php  that
 was added in PHP 5
 
 Thanks, Mark
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 

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



Re: [PHP] Timezone and DST

2006-01-05 Thread Chris Boget
I've got a little problem where our servers are in PST but the 
customer operates in Hawaii (-10 GMT). I believe I can just get the 
time for them by doing something like

date(d H i, strtotime('now -2 hours') );
But here's the catch, how should I deal with day light savings ( DST) 
. In hawaii they don't observer DST, but in Washington State we do.


You can use date( 'I' ) to determine whether or not your server is
currently in DST and subtract the appropriate number of hours
accordingly...

thnx,
Chris

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