From: Michael Orlitzky Date: Sun, 1 Jun 2014 04:11:37 +0000 (-0400) Subject: Use a UTCTime for the Heartbeat timestamp. X-Git-Tag: 0.0.6~253 X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=22ef5496c109815e1c97d9350181b4a96145fb94;p=dead%2Fhtsn-import.git Use a UTCTime for the Heartbeat timestamp. --- diff --git a/src/TSN/XML/Heartbeat.hs b/src/TSN/XML/Heartbeat.hs index 89b91ad..8fafba1 100644 --- a/src/TSN/XML/Heartbeat.hs +++ b/src/TSN/XML/Heartbeat.hs @@ -10,6 +10,7 @@ module TSN.XML.Heartbeat ( where -- System imports. +import Data.Time.Clock ( UTCTime ) import Data.Tuple.Curry ( uncurryN ) import Test.Tasty ( TestTree, testGroup ) import Test.Tasty.HUnit ( (@?=), testCase ) @@ -25,6 +26,7 @@ import Text.XML.HXT.Core ( -- Local imports. import TSN.DbImport ( ImportResult(..) ) +import TSN.Picklers ( xp_time_stamp ) import Xml ( pickle_unpickle, unpickleable ) @@ -40,7 +42,7 @@ data Message = Message { xml_file_id :: Int, heading :: String, - time_stamp :: String } + time_stamp :: UTCTime } deriving (Eq, Show) @@ -53,7 +55,7 @@ pickle_message = xpWrap (from_tuple, to_tuple) $ xpTriple (xpElem "XML_File_ID" xpInt) (xpElem "heading" xpText) - (xpElem "time_stamp" xpText) + (xpElem "time_stamp" xp_time_stamp) where from_tuple = uncurryN Message to_tuple m = (xml_file_id m,