This class is just a collection of time utility functions. More...
#include <DwmTimeUtil.hh>
Static Public Member Functions | |
| static void | GmTime (time_t unixsecs, struct tm &result) |
This is just a convenient wrapper for gmtime(time_t *) that stores the result in result. | |
| static void | LocalTime (time_t unixsecs, struct tm &result) |
This is just a convenient wrapper for localtime(time_t *) that stores the result in result. | |
| static bool | SubtractTimeval (const struct timeval &lhs, const struct timeval &rhs, struct timeval &result) |
Subtracts rhs from lhs and places the result in result. | |
| static bool | ParseDateTime (const std::string &dateTimeString, struct tm &tm) |
Parses dateTimeString and stores the resulting time in tm. | |
| static bool | ParseDateTime (const std::string &dateTimeString, time_t &t) |
Parses dateTimeString and stores the resulting time in t. | |
| static time_t | MidnightDaysLater (int daysLater) |
Returns the time for midnight (00:00) at the given daysLater. | |
This class is just a collection of time utility functions.
|
static |
Returns the time for midnight (00:00) at the given daysLater.
For example, if daysLater is 1, we'll return the upcoming midnight time (useful when rolling over log files, etc.).
|
static |
Parses dateTimeString and stores the resulting time in tm.
Returns true on success, false on failure. dateTimeString must contain a date of one of the following forms:
YYYYMMDD YYYY/MM/DD MM/DD/YYYY Jan DD, YYYY Jan DD YYYY
dataTimeString may have a space and a time after the date, where the time must be of the form HH:MM:SS (minutes and seconds are optional, and will default to 0 if not specified).
|
static |
Parses dateTimeString and stores the resulting time in t.
Returns true on success, false on failure. dateTimeString must contain a date of one of the following forms:
YYYYMMDD YYYY/MM/DD MM/DD/YYYY Jan DD, YYYY Jan DD YYYY
dataTimeString may have a space and a time after the date, where the time must be of the form HH:MM:SS (minutes and seconds are optional, and will default to 0 if not specified).
|
static |
Subtracts rhs from lhs and places the result in result.
Returns true if the result is positive (lhs greater than rhs), else returns false.