Changeset 15006
- Timestamp:
- 03/10/13 11:13:26 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Time.cc
r13954 r15006 40 40 const _time_format Time::sql = "%Y-%m-%d %H:%M:%S.%f"; 41 41 const _time_format Time::ssql = "%Y-%m-%d %H:%M:%S"; 42 const _time_format Time::iso = "%Y %m%dT%H%M%S%F%q";42 const _time_format Time::iso = "%Y-%m-%dT%H:%M:%S%F%q"; 43 43 const _time_format Time::magic = "%Y %m %d %H %M %S %f"; 44 44 const _time_format Time::smagic = "%Y %m %d %H %M %S"; … … 243 243 { 244 244 stringstream out; 245 out << Time:: fmt("%Y-%m-%dT%H:%M:%S%F")<< *this;245 out << Time::iso << *this; 246 246 return out.str(); 247 247 } -
trunk/FACT++/src/Time.h
r14542 r15006 25 25 /// initialize ptr with what should be passed to the iostreams 26 26 _time_format(const char *txt) : ptr(txt) { } 27 std::string str() const { return ptr; } 27 28 }; 28 29 … … 53 54 }; 54 55 55 p rivate:56 public: 56 57 /// Points to the famous 1/1/1970, the standard offset for unix times 57 58 const static boost::gregorian::date fUnixOffset; … … 67 68 unsigned int us=0); 68 69 Time(double mjd) { Mjd(mjd); } 70 Time(const std::string &str) 71 { 72 std::stringstream stream; 73 stream << str; 74 stream >> Time::iso >> *this; 75 } 69 76 70 77 // Convesion from and to a string
Note:
See TracChangeset
for help on using the changeset viewer.