Changeset 10454


Ignore:
Timestamp:
04/22/11 20:50:41 (14 years ago)
Author:
tbretz
Message:
Added GetUnixTime
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r10252 r10454  
    159159// --------------------------------------------------------------------------
    160160//
     161// Return seconds since 1970/1/1
     162//
     163time_t Time::GetUnixTime() const
     164{
     165    const time_duration unx = *this - ptime(fUnixOffset);
     166    return unx.total_seconds();
     167}
     168
     169// --------------------------------------------------------------------------
     170//
    161171//! Returns a string with the contents of the Time object formated
    162172//! as defined in format.
     
    277287    return in;
    278288}
     289
  • trunk/FACT++/src/Time.h

    r10324 r10454  
    9090    unsigned int   ms() const { return time_of_day().total_milliseconds()%1000; }
    9191    unsigned int   us() const { return time_of_day().total_microseconds()%1000000; }
     92
     93    time_t GetUnixTime() const;
     94
    9295};
    9396
Note: See TracChangeset for help on using the changeset viewer.