aboutsummaryrefslogtreecommitdiff
path: root/src/executable/haskell/Utils/Time.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/executable/haskell/Utils/Time.hs')
-rw-r--r--src/executable/haskell/Utils/Time.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/executable/haskell/Utils/Time.hs b/src/executable/haskell/Utils/Time.hs
new file mode 100644
index 0000000..b6045a7
--- /dev/null
+++ b/src/executable/haskell/Utils/Time.hs
@@ -0,0 +1,14 @@
+module Utils.Time
+ ( getCurrentFormattedTime
+ ) where
+
+import Data.Text (Text)
+import qualified Data.Text as T
+
+import Data.Time.Format (defaultTimeLocale, formatTime)
+import Data.Time.LocalTime (getZonedTime)
+
+getCurrentFormattedTime :: IO Text
+getCurrentFormattedTime = do
+ zonedTime <- getZonedTime
+ return (T.pack $ formatTime defaultTimeLocale "%Hh%M" zonedTime)