module RIO.Time
  ( module Data.Time
  , getCurrentTime
  , getTimeZone
  , getCurrentTimeZone
  , getZonedTime
  , utcToLocalZonedTime
  ) where

import Control.Monad.IO.Class
import Data.Time hiding( getCurrentTime, getTimeZone, getCurrentTimeZone
                       , getZonedTime, utcToLocalZonedTime)
import qualified Data.Time

getCurrentTime :: MonadIO m => m UTCTime
getCurrentTime :: m UTCTime
getCurrentTime = IO UTCTime -> m UTCTime
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO UTCTime
Data.Time.getCurrentTime

getTimeZone :: MonadIO m => UTCTime -> m TimeZone
getTimeZone :: UTCTime -> m TimeZone
getTimeZone = IO TimeZone -> m TimeZone
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TimeZone -> m TimeZone)
-> (UTCTime -> IO TimeZone) -> UTCTime -> m TimeZone
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UTCTime -> IO TimeZone
Data.Time.getTimeZone

getCurrentTimeZone :: MonadIO m => m TimeZone
getCurrentTimeZone :: m TimeZone
getCurrentTimeZone = IO TimeZone -> m TimeZone
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO TimeZone
Data.Time.getCurrentTimeZone

getZonedTime :: MonadIO m => m ZonedTime
getZonedTime :: m ZonedTime
getZonedTime = IO ZonedTime -> m ZonedTime
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO ZonedTime
Data.Time.getZonedTime

utcToLocalZonedTime :: MonadIO m => UTCTime -> m ZonedTime
utcToLocalZonedTime :: UTCTime -> m ZonedTime
utcToLocalZonedTime = IO ZonedTime -> m ZonedTime
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ZonedTime -> m ZonedTime)
-> (UTCTime -> IO ZonedTime) -> UTCTime -> m ZonedTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UTCTime -> IO ZonedTime
Data.Time.utcToLocalZonedTime