Changeset 11439 for trunk/FACT++/src


Ignore:
Timestamp:
07/18/11 14:40:03 (13 years ago)
Author:
tbretz
Message:
Added Iso() member function.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Time.cc

    r11393 r11439  
    224224// --------------------------------------------------------------------------
    225225//
     226//! @returns
     227//!     a human readable string which complies with ISO 8601, in the
     228//!    "CCYY-MM-DDThh:mm:ss.f"
     229//
     230string Time::Iso() const
     231{
     232    stringstream out;
     233    out << Time::fmt("%Y-%m-%dT%H:%M:%S%F") << *this;
     234    return out.str();
     235}
     236
     237// --------------------------------------------------------------------------
     238//
    226239//! Sets the time of the Time object to a time corresponding to
    227240//! the one given as argument. It is evaluated according to the given
  • trunk/FACT++/src/Time.h

    r11393 r11439  
    7272    void SetFromStr(const std::string &str, const char *fmt="%Y-%m-%d %H:%M:%S");
    7373
     74    std::string Iso() const;
     75
    7476    // Conversion to and from MJD
    7577    void Mjd(double mjd);
Note: See TracChangeset for help on using the changeset viewer.