From cc8a305b37f5044da8d958702cb886f84bb4d5e9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 18:39:33 -0400 Subject: [PATCH] ISO8601d: Added ::toEpoch --- src/ISO8601.cpp | 6 ++++++ src/ISO8601.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index f75939878..fb1332f56 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -840,6 +840,12 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start) return false; } +//////////////////////////////////////////////////////////////////////////////// +time_t ISO8601d::toEpoch () +{ + return _date; +} + //////////////////////////////////////////////////////////////////////////////// std::string ISO8601d::toEpochString () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 45e4796b3..87730df8c 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -46,6 +46,7 @@ public: operator time_t () const; bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); + time_t toEpoch (); std::string toEpochString (); double toJulian (); void toMDY (int&, int&, int&);