chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Re: srfi-19 local-timezone-locale


From: Kon Lovett
Subject: [Chicken-users] Re: srfi-19 local-timezone-locale
Date: Sun, 1 Apr 2007 12:35:05 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Apr 1, 2007, at 10:14 AM, Hans Bulfone wrote:

hi,


<snip>
thanks!

i hate to say this but it still doesn't work on my system :(

should the tz offset in the tz string constructed in
make-local-timezone-locale be east or west of utc?

Positive for west. So PST is +8:00 & CET is -1:00:

"If preceded by a (`-') the time zone shall be east of the Prime Meridian; otherwise it shall be west (which may be indicated by an optional preceding (`+'))."

But SRFI-19 uses the reverse:

"The field tm_gmtoff is the offset (in seconds) of the time represented from UTC, with positive values indicating east of the Prime Meridian."


if i unterstand correctly, it should be west of utc,
which is what seconds->local-time returns on my system
(and also should return according to the docs @ callcc.org).
so imho the sign of the timezone offset shouldn't be
flipped on linux.

imho seconds->local-time should be fixed so that it at least
returns the timezone offset with the same sign interpretation
on all systems.  it imho now returns seconds east of utc
on mac os x and seconds west of utc on all other platforms.

Yes, different meaning on MacOS X from, it seems, everything else.

MacOS X:

#;2> (local-timezone-locale)
(#t (name . "XXXX+8:0:0PST+7:0:0") (source . "POSIX") (std-name . "XXXX") (std-offset . 28800) (dst-name . "PST") (dst-offset . 25200) (dst-start (4 1 0) . 3600) (dst-end (10 5 0) . 3600))
#;3> (timezone-locale-offset)
- -25200
#;4> (seconds->local-time (current-seconds))
#(56 32 12 1 3 107 0 90 #t -25200)

Windows:

#;2> (local-timezone-locale)
(#t (name . "XXXX+8:0:0XXXX+7:0:0") (source . "POSIX") (std-name . "XXXX") (std-offset . 28800) (dst-name . "XXXX") (dst-offset . 25200) (dst-start (4 1 0) . 3600) (dst-end (10 5 0) . 3600))
#;3> (timezone-locale-offset)
- -25200
#;4> (seconds->local-time (current-seconds))
#(30 7 12 1 3 107 0 90 #t 28800)

Sigh, please get 2.6.5; this is fixed.

Note that 'ftime' & 'gettimeofday' both return a positive value for the tz offset in minutes (i.e. west of UTC) in MacOS X. This might be a better x-platform source.

felix, what do you think about this?

BTW, what does '(vector-ref (seconds->local-time (current-seconds))
8)' return?

#;8> (vector-ref (seconds->local-time (current-seconds)) 8)
#t

bye,
hans.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iEYEARECAAYFAkYQCWoACgkQJJNoeGe+5O5fjQCfQOSB2P0omCO7OgGRGHUYQTjG
TrwAn2gfoUmmYWA8qX6/dbrakk8mzlRI
=z2bm
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]