-- | Some helper functions for "Data.Time"
module Data.Time.Ext
  ( module Data.Time
  , getLocalTime
  , getLocalDay
  ) where

import Data.Time

-- | Return the current time in the system time zone.
getLocalTime :: IO LocalTime
getLocalTime :: IO LocalTime
getLocalTime = ZonedTime -> LocalTime
zonedTimeToLocalTime (ZonedTime -> LocalTime) -> IO ZonedTime -> IO LocalTime
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO ZonedTime
getZonedTime

-- | Return the current day in the system time zone.
getLocalDay :: IO Day
getLocalDay :: IO Day
getLocalDay = LocalTime -> Day
localDay (LocalTime -> Day) -> IO LocalTime -> IO Day
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO LocalTime
getLocalTime