diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 8bbfabc36..ae78d5a61 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1004,13 +1004,13 @@ void ISO8601d::resolve () } //////////////////////////////////////////////////////////////////////////////// -time_t ISO8601d::toEpoch () +time_t ISO8601d::toEpoch () const { return _date; } //////////////////////////////////////////////////////////////////////////////// -std::string ISO8601d::toEpochString () +std::string ISO8601d::toEpochString () const { std::stringstream epoch; epoch << _date; @@ -1019,7 +1019,7 @@ std::string ISO8601d::toEpochString () //////////////////////////////////////////////////////////////////////////////// // 19980119T070000Z = YYYYMMDDThhmmssZ -std::string ISO8601d::toISO () +std::string ISO8601d::toISO () const { struct tm* t = gmtime (&_date); @@ -1037,13 +1037,13 @@ std::string ISO8601d::toISO () } //////////////////////////////////////////////////////////////////////////////// -double ISO8601d::toJulian () +double ISO8601d::toJulian () const { return (_date / 86400.0) + 2440587.5; } //////////////////////////////////////////////////////////////////////////////// -void ISO8601d::toMDY (int& m, int& d, int& y) +void ISO8601d::toMDY (int& m, int& d, int& y) const { struct tm* t = localtime (&_date); diff --git a/src/ISO8601.h b/src/ISO8601.h index 6af7f96f6..48aeeb528 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -47,11 +47,11 @@ public: operator time_t () const; bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); - time_t toEpoch (); - std::string toEpochString (); - std::string toISO (); - double toJulian (); - void toMDY (int&, int&, int&); + time_t toEpoch () const; + std::string toEpochString () const; + std::string toISO () const; + double toJulian () const; + void toMDY (int&, int&, int&) const; const std::string toString (const std::string& format = "m/d/Y") const; ISO8601d startOfDay () const;