chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] srfi-19 timezone problems


From: Kon Lovett
Subject: Re: [Chicken-users] srfi-19 timezone problems
Date: Tue, 27 Mar 2007 18:28:28 -0700

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

On Mar 27, 2007, at 2:57 PM, Hans Bulfone wrote:


<snip>
np, thanks for the quick fix!

but i still get the wrong time:

#;7> (values (current-date) (current-date (local-timezone-locale)) (current-date 7200))
#,(date 403000116 9 36 21 27 3 2007 0 UTC #f 2 86)
#,(date 403000000 9 36 20 27 3 2007 -3600 CET #t #f #f)
#,(date 403000000 9 36 23 27 3 2007 7200 #f #f #f #f)
#;8> (timezone-locale-offset (local-timezone-locale))
-3600
#;9>

the timezone offset should be 3600 during winter and 7200 during
summer time (which has started last weekend).

i think the time zone offset from the locale is applied with the
wrong sign.

Yes. The TZ env-var is parsed properly by the locale egg but the tz- offset was used incorrectly by my srfi-19 code. (Well, I did have my locale documentation wrong. Said the opposite of what is true.)

2.6.3 will be available Wed (earlier if I can figure out why I can't build).

Sorry, again,
Kon


i just found this in libc.info about the TZ variable:

------------------------------------------------------------
   The first format is used when there is no Daylight Saving Time (or
summer time) in the local time zone:

     STD OFFSET

   The STD string specifies the name of the time zone.  It must be
three or more characters long [...]

   The OFFSET specifies the time value you must add to the local time
to get a Coordinated Universal Time value.  It has syntax like
[`+'|`-']HH[`:'MM[`:'SS]].  This is positive if the local time zone is
west of the Prime Meridian and negative if it is east.  The hour must
be between `0' and `23', and the minute and seconds between `0' and
`59'.

For example, here is how we would specify Eastern Standard Time, but
without any Daylight Saving Time alternative:

     EST+5
------------------------------------------------------------

this is the opposite of the normal way to specify the time zone offset
where you specify the time value you must add to UTC to get local time
(like in ISO 8601)

so CEST-2:00 would be correct:

address@hidden:~$ date ; TZ=CEST-2 date ; TZ=Europe/Vienna date
Tue Mar 27 23:54:04 CEST 2007
Tue Mar 27 23:54:04 CEST 2007
Tue Mar 27 23:54:04 CEST 2007
address@hidden:~$

bye,
hans.

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

iEYEARECAAYFAkYJxLwACgkQJJNoeGe+5O5JXwCeOehDALOTQo+zW5MxJn0qBeSW
pIUAniFR7V229maoQOj5jK0mC3brqjn3
=jnfs
-----END PGP SIGNATURE-----




reply via email to

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