From bb218c88f870e3468461fc8e3b7d66839e11919d Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 12 Jan 2001 17:04:00 +0000 Subject: [PATCH] [project @ 2001-01-12 17:04:00 by simonmar] Add a comment about the tzname[] stuff --- ghc/lib/std/Time.hsc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ghc/lib/std/Time.hsc b/ghc/lib/std/Time.hsc index 86423a9..9619d77 100644 --- a/ghc/lib/std/Time.hsc +++ b/ghc/lib/std/Time.hsc @@ -1,5 +1,5 @@ -- ----------------------------------------------------------------------------- --- $Id: Time.hsc,v 1.3 2001/01/12 16:44:13 simonmar Exp $ +-- $Id: Time.hsc,v 1.4 2001/01/12 17:04:00 simonmar Exp $ -- -- (c) The University of Glasgow, 1995-2001 -- @@ -327,11 +327,11 @@ normalizeTimeDiff td = } -- ----------------------------------------------------------------------------- --- toCalendarTime t converts t to a local time, modified by --- the current timezone and daylight savings time settings. toUTCTime --- t converts t into UTC time. toClockTime l converts l into the --- corresponding internal ClockTime. The wday, yday, tzname, and isdst fields --- are ignored. +-- How do we deal with timezones on this architecture? + +-- The POSIX way to do it is through the global variable tzname[]. +-- But that's crap, so we do it The BSD Way if we can: namely use the +-- tm_zone and tm_gmtoff fields of struct tm, if they're available. #if HAVE_TM_ZONE zone x = (#peek struct tm,tm_zone) x :: IO (Ptr CChar) @@ -375,6 +375,13 @@ gmtoff x = do # endif /* ! HAVE_ALTZONE */ #endif /* ! HAVE_TM_ZONE */ +-- ----------------------------------------------------------------------------- +-- toCalendarTime t converts t to a local time, modified by +-- the current timezone and daylight savings time settings. toUTCTime +-- t converts t into UTC time. toClockTime l converts l into the +-- corresponding internal ClockTime. The wday, yday, tzname, and isdst fields +-- are ignored. + toCalendarTime :: ClockTime -> IO CalendarTime toCalendarTime = clockToCalendarTime localtime False -- 1.7.10.4