module Date ( getCurrentDate ) where import Data.Time.Clock import Data.Time.Calendar import Data.Time.LocalTime import Model.Date getCurrentDate :: IO Date getCurrentDate = do now <- getCurrentTime timezone <- getCurrentTimeZone let zoneNow = utcToLocalTime timezone now let (y, m, _) = toGregorian $ localDay zoneNow return (Date m (fromIntegral y))