From 20eb4cfb330b2a7ed9849823d8c25c8cfb46347a Mon Sep 17 00:00:00 2001 From: Jonathan Grochowski Date: Sat, 3 Mar 2012 22:54:36 -0800 Subject: Update the DateZone plugin to use newer time package Just as the Date plugin used the old-time package which would honor all the available flags, so too did the DateZone plugin. --- src/Plugins/DateZone.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Plugins/DateZone.hs b/src/Plugins/DateZone.hs index 86114bb..79596c9 100644 --- a/src/Plugins/DateZone.hs +++ b/src/Plugins/DateZone.hs @@ -34,7 +34,6 @@ import Data.Time.LocalTime.TimeZone.Series import System.IO.Unsafe import System.Locale (TimeLocale) -import System.Time @@ -62,11 +61,9 @@ instance Exec DateZone where where go func = func >>= cb >> tenthSeconds r >> go func date :: String -> TimeLocale -> IO String -date format loc = do - t <- toCalendarTime =<< getClockTime - return $ formatCalendarTime loc format t +date format loc = getZonedTime >>= return . formatTime loc format dateZone :: String -> TimeLocale -> TimeZoneSeries -> IO String -dateZone format loc timeZone = do - zonedTime <- getZonedTime - return $ formatTime loc format $ utcToLocalTime' timeZone $ zonedTimeToUTC zonedTime +dateZone format loc timeZone = getZonedTime >>= return . formatTime loc format . utcToLocalTime' timeZone . zonedTimeToUTC +-- zonedTime <- getZonedTime +-- return $ formatTime loc format $ utcToLocalTime' timeZone $ zonedTimeToUTC zonedTime -- cgit v1.2.3