From 22ef5496c109815e1c97d9350181b4a96145fb94 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 1 Jun 2014 00:11:37 -0400 Subject: [PATCH] Use a UTCTime for the Heartbeat timestamp. --- src/TSN/XML/Heartbeat.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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, -- 2.43.2