module Time
  ( getCurrentFormattedTime
  ) where

import Data.Text (Text)
import qualified Data.Text as T

import Data.Time.Clock (getCurrentTime)
import Data.Time.LocalTime (getCurrentTimeZone, utcToLocalTime)
import Data.Time.Format (formatTime, defaultTimeLocale)

getCurrentFormattedTime :: IO Text
getCurrentFormattedTime = do
  currentTime <- getCurrentTime
  timeZone <- getCurrentTimeZone
  let localTime = utcToLocalTime timeZone currentTime
  return (T.pack $ formatTime defaultTimeLocale "%T" localTime)