chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] choosing right timezone for future date


From: John Cowan
Subject: Re: [Chicken-users] choosing right timezone for future date
Date: Mon, 28 Jan 2008 14:12:35 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

Graham Fawcett scripsit:

> This may not be Chicken-specific, but is there an existing library
> that, given a date (year,month,day) and given the current locale, will
> tell me the timezone in which the date falls? I'm in the EST zone, but
> during warmer months, dates fall within the EDT zone. I'd like to be
> able to create a date and have the library provide the correct
> timezone. (Unix-specific answers are OK.)

The locale as such is not relevant to time zones, which are stored in
the TZ environment variable.  ("en_US" is just one locale, but it
spans eight time zones.)

> I can't find anything in SRFI-19 to help me here. Using date(1), I can
> do 'date -d "yyyymmdd" +%z' but that seems silly...

strftime(3), which should be in unit posix but isn't, is your friend;
it's the library routine underlying date(1).

-- 
Winter:  MIT,                                   John Cowan
Keio, INRIA,                                    address@hidden
Issue lots of Drafts.                           http://www.ccil.org/~cowan
So much more to understand!
Might simplicity return?                        (A "tanka", or extended haiku)




reply via email to

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