/** @class UTC_Conv @author Brian Magill @creation date 9/08/2006 @brief wrapper for gmtime */ #include "UTC_Conv.h" #include #include using namespace std; UTC_Conv::UTC_Conv(time_t const & t) { time = gmtime(&t); }; void UTC_Conv::operator() (time_t const &t) { time = gmtime(&t); }; int UTC_Conv::Sec() const { return time->tm_sec; }; int UTC_Conv::Min() const { return time->tm_min; }; int UTC_Conv::Hour() const { return time->tm_hour; }; int UTC_Conv::Doy() const { return 1 + time->tm_yday; }; int UTC_Conv::Year() const { return 1900 + time->tm_year; }; int UTC_Conv::SinceMidnight() const { const int SecPerHour = 3600; const int SecPerMin = 60; return SecPerHour*Hour() + SecPerMin*Min() + Sec(); }; void UTC_Conv::dump() { cout << "Year = " << time->tm_year << endl; cout << "Doy = " << time->tm_yday << endl; cout << "Month = " << time->tm_mon << endl; cout << "Day of Month = " << time->tm_mday << endl; cout << "Hour = " << time->tm_hour << endl; cout << "Min = " << time->tm_min << endl; cout << "Sec = " << time->tm_sec << endl; };