#include <time.h>
|
|
| timestamp (void) |
| | constructors
|
| |
|
| timestamp (time_t t) |
| |
|
bool | is_null (void) const |
| | checks for null time
|
| |
| | timestamp (int year, int month, int day, int hour, int minute, int second, int dst=-1) |
| |
| void | format (const std::string &format, std::string &out, bool gmt=false) const |
| |
|
int | get_day (void) const |
| | gets the day of the time value (1-31)
|
| |
|
int | get_day_of_week (void) const |
| | gets the day of the week of the time value (0-6, 0=Sunday)
|
| |
|
int | get_hour (void) const |
| | gets the hour of the local time value (0-23, 0=Sunday)
|
| |
|
int | get_minute (void) const |
| | gets the minute of the time value (0-59)
|
| |
|
int | get_month (void) const |
| | gets the month of the time value (0-11, 0=January)
|
| |
|
int | get_second (void) const |
| | gets the second of the time value (0-59)
|
| |
|
int | get_year (void) const |
| | gets the year of the time value (current year minus 1900)
|
| |
|
time_t | get_time (void) const |
| | gets the current time value (seconds since January 1, 1970)
|
| |
| tm * | get_tm (void) const |
| |
|
bool | operator< (timestamp rhs) const |
| | comparison operators
|
| |
|
bool | operator<= (timestamp rhs) const |
| |
|
bool | operator> (timestamp rhs) const |
| |
|
bool | operator>= (timestamp rhs) const |
| |
|
bool | operator== (timestamp rhs) const |
| |
|
bool | operator!= (timestamp rhs) const |
| |
| timestamp | operator+ (timespan rhs) const |
| |
|
timestamp | operator+= (timespan rhs) |
| |
|
timestamp | operator- (timespan rhs) const |
| |
|
timestamp | operator-= (timespan rhs) |
| |
|
timestamp & | operator= (timestamp rhs) |
| | assignment operators
|
| |
|
timestamp & | operator= (time_t rhs) |
| |
|
timespan | operator- (timestamp rhs) const |
| | subtraction operator to retreive the timespan difference of two times
|
| |
|
|
static timestamp | current_time (void) |
| | gets the current time for the local time zone
|
| |
|
static int | string_to_month (const std::string &month) |
| | converts a 3 letter string to a numberic month
|
| |
time class
- Author
- Aleksander Demko
◆ timestamp()
| scopira::tool::timestamp::timestamp |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
int |
second, |
|
|
int |
dst = -1 |
|
) |
| |
constructor initializes a time with the following parameters parameters should be based on local time
- Parameters
-
| year | 1900.. |
| month | 0..11 |
| day | 1..31 |
| hour | 0..23 |
| minute | 0..59 |
| second | 0..59 |
| dst | <0 for default, 0 if dst not in effect, >0 if dst in effect |
- Author
- Aleksander Demko
◆ format()
| void scopira::tool::timestamp::format |
( |
const std::string & |
format, |
|
|
std::string & |
out, |
|
|
bool |
gmt = false |
|
) |
| const |
formats the time using a format string
- Parameters
-
| format | a format string (see docs for strftime for format details) the formatted time create a gmt formatted time |
- Author
- Aleksander Demko
◆ get_tm()
| tm* scopira::tool::timestamp::get_tm |
( |
void |
| ) |
const |
|
inline |
gets the a tm struct of the local time Get the time data with this method and then get individual data items if more than one time unit is needed.
- Returns
- the tm struct
- Author
- Aleksander Demko
◆ operator+()
addition and subtraction operators add and subtract timespan objects from time
The documentation for this class was generated from the following file: