Re: [PHP-DEV] Timezone offset differences

2001-01-18 Thread Andrei Zmievski

On Wed, 17 Jan 2001, Chuck Hagenbuch wrote:
> For the record, I reported a similar problem on win32 a while ago, though it 
> was with date('r') (rfc822 date), but showed the same thing - wrong sign for 
> the timezone offset.

Fixed.

-Andrei

"Music expresses that which can not be said
 and on which it is impossible to be silent."
 -Victor Hugo

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Timezone offset differences

2001-01-17 Thread Chuck Hagenbuch

Quoting Jim Winstead <[EMAIL PROTECTED]>:

> i didn't check how date('Z') is defined (do you add it to local time to get
> UTC or subtract it?) but it may be that systems where struct tm has a
> tm_gmtoff member and systems that use the timezone global may
> define it different ways.
> 
> they should be made consistent, and the date() documentation updated to
> tell exactly which way we've made it consistent. :)

For the record, I reported a similar problem on win32 a while ago, though it 
was with date('r') (rfc822 date), but showed the same thing - wrong sign for 
the timezone offset.

-chuck

--
Charles Hagenbuch, <[EMAIL PROTECTED]>
Entropy. It's what's for dinner.

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Timezone offset differences

2001-01-17 Thread Jim Winstead

On Wed, Jan 17, 2001 at 01:58:14PM -0600, Andrei Zmievski wrote:
> On Wed, 17 Jan 2001, Jim Winstead wrote:
> > i didn't check how date('Z') is defined (do you add it to local time to get
> > UTC or subtract it?) but it may be that systems where struct tm has a
> > tm_gmtoff member and systems that use the timezone global may
> > define it different ways.
> 
> Well, I am in Central timezone so I'd expect my offset to be -21600 (-6
> hours). So, the formula should be UTC + offset.
> 
> > they should be made consistent, and the date() documentation updated to
> > tell exactly which way we've made it consistent. :)
> 
> And making it consistent would just involve reversing the sign on
> tm_gmtoff member? I just wonder if the sign of tm_gmtoff is consistent
> between platforms.

according to the examples i can find in the single unix spec,
i'd expect timezone to be positive for US/Central time.

http://www.opengroup.org/onlinepubs/007908799/xsh/tzset.html

tm_gmtoff appears to be defined the opposite way.

http://www.netppl.fi/~pp/glibc21/libc_20.html#SEC406

i'd say pick one, and document it.

jim

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Timezone offset differences

2001-01-17 Thread Andrei Zmievski

On Wed, 17 Jan 2001, Jim Winstead wrote:
> i didn't check how date('Z') is defined (do you add it to local time to get
> UTC or subtract it?) but it may be that systems where struct tm has a
> tm_gmtoff member and systems that use the timezone global may
> define it different ways.

Well, I am in Central timezone so I'd expect my offset to be -21600 (-6
hours). So, the formula should be UTC + offset.

> they should be made consistent, and the date() documentation updated to
> tell exactly which way we've made it consistent. :)

And making it consistent would just involve reversing the sign on
tm_gmtoff member? I just wonder if the sign of tm_gmtoff is consistent
between platforms.

-Andrei

"The secret of flying is to throw yourself
at the ground, and miss." -- Douglas Adams

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Timezone offset differences

2001-01-17 Thread Jim Winstead

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]  wrote:
> Right now date('Z') returns timezone offset with different signs on
> Linux and Solaris. For my timezone I get -21600 on Linux and 21600 on
> Solaris. What would be a good way to fix it so that it's consistent?

i didn't check how date('Z') is defined (do you add it to local time to get
UTC or subtract it?) but it may be that systems where struct tm has a
tm_gmtoff member and systems that use the timezone global may
define it different ways.

they should be made consistent, and the date() documentation updated to
tell exactly which way we've made it consistent. :)

jim

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]