summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-10 15:23:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-10 15:23:38 -0400
commit4adfc408b6937ff978745a67600ba732771c2b46 (patch)
treedebd8336fbaf757ebeeb3db375061cf9fe1062a7
parentea506b28110d0e23210fb788b16ffe3deb92f23b (diff)
forgot to add new module
-rw-r--r--Logs/TimeStamp.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Logs/TimeStamp.hs b/Logs/TimeStamp.hs
new file mode 100644
index 000000000..2832a3d65
--- /dev/null
+++ b/Logs/TimeStamp.hs
@@ -0,0 +1,21 @@
+{- log timestamp parsing
+ -
+ - Copyright 2015 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+{-# LANGUAGE CPP #-}
+
+module Logs.TimeStamp where
+
+import Data.Time.Clock.POSIX
+import Data.Time
+#if ! MIN_VERSION_time(1,5,0)
+import System.Locale
+#endif
+
+import Common
+
+parsePOSIXTime :: String -> Maybe POSIXTime
+parsePOSIXTime s = utcTimeToPOSIXSeconds <$> parseTime defaultTimeLocale "%s%Qs" s