ISO8601d: Added ::toJulian

This commit is contained in:
Paul Beckingham 2015-09-26 16:19:56 -04:00
parent 7a5025e64d
commit c0bc6059ca
2 changed files with 7 additions and 0 deletions

View file

@ -840,6 +840,12 @@ bool ISO8601p::parse (const std::string& input, std::string::size_type& start)
return false; return false;
} }
////////////////////////////////////////////////////////////////////////////////
double ISO8601d::toJulian ()
{
return (_date / 86400.0) + 2440587.5;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void ISO8601d::toMDY (int& m, int& d, int& y) void ISO8601d::toMDY (int& m, int& d, int& y)
{ {

View file

@ -46,6 +46,7 @@ public:
operator time_t () const; operator time_t () const;
bool parse (const std::string&, std::string::size_type&, const std::string& format = ""); bool parse (const std::string&, std::string::size_type&, const std::string& format = "");
double toJulian ();
void toMDY (int&, int&, int&); void toMDY (int&, int&, int&);
ISO8601d startOfDay () const; ISO8601d startOfDay () const;