blob: a7fb418bc70146a0f2fb8b7e3b8f421f9c573e33 (
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 "%Hh%M" localTime)
|