diff options
author | Joris Guyonvarch | 2015-04-12 23:16:30 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-04-12 23:16:30 +0200 |
commit | c0cfd3cb3d7a963cebb40f88868e5628f361376f (patch) | |
tree | 94f767f6df9b1c0dab58b9f186e5e9085097da8b /src/Time.hs | |
parent | 10a9aa9391ac2995527557d9d808693b57236603 (diff) |
Show the current time when new ads are available
Diffstat (limited to 'src/Time.hs')
-rw-r--r-- | src/Time.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Time.hs b/src/Time.hs new file mode 100644 index 0000000..9f35bf0 --- /dev/null +++ b/src/Time.hs @@ -0,0 +1,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) |