blob: 9f35bf0a5cdffc2826bdc718e4df2795c626c791 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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)
|