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: Hans Bulfone
Subject: Re: [Chicken-users] srfi-19 timezone problems
Date: Tue, 27 Mar 2007 23:57:02 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

hi,

On Mon, Mar 26, 2007 at 11:21:29PM -0700, Kon Lovett wrote:
> Please get the new locale (0.3) & srfi-19 (2.6.2) eggs.
> 
> With TZ=CEST2:00 (incorrect but enough to test)
> 
> #;2> (values (current-date) (current-date (local-timezone-locale))  
> (current-date 7200))
> #,(date 522000074 10 15 6 27 3 2007 0 UTC #f 2 86)
> #,(date 563000000 10 15 8 27 3 2007 7200 CEST #f #f #f)
> #,(date 568000000 10 15 8 27 3 2007 7200 #f #f #f #f)
> 
> Sorry you had to report this,
> Kon

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.

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.




reply via email to

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