-- | Utils.hs -- A module for some helper functions. module Utils ( nowTime, utcToZoned ) where import System.Locale import Data.Time.LocalTime import Data.Time.Format -- | Print current time. nowTime = getZonedTime >>= format -- | Convert UTC string (from jabber:x:delay) to zoned. utcToZoned :: String -> IO String utcToZoned t = (utcToLocalZonedTime $ readTime defaultTimeLocale "%Y%m%dT%H:%M:%S" t) >>= format format = return . formatTime defaultTimeLocale "%H:%M:%S"