#include <sttime.h>
Public Member Functions | |
StTime () | |
StTime (time_t time) | |
void | setTime (int year, int month, int day, int hour, int minute, int second) |
void | setTime (time_t time) |
void | setTime (tm *time) |
time_t | getTime () |
void | setYear (int year) |
void | setMonth (int month) |
void | setDay (int day) |
void | setHour (int hour) |
void | setMin (int minute) |
void | setSec (int second) |
int | getYear () const |
int | getMonth () const |
int | getDay () const |
int | getHour () const |
int | getMin () const |
int | getSec () const |
bool | greaterThan (const StTime &otherTime) |
bool | lowerThan (const StTime &otherTime) |
bool | equal (const StTime &otherTime) |
bool | operator> (const StTime &otherTime) |
bool | operator< (const StTime &otherTime) |
bool | operator== (const StTime &otherTime) |
int | diffrence (StTime time) |
void | clear () |
Static Public Member Functions | |
static StTime | getCurrentTime () |
Private Member Functions | |
void | init () |
Private Attributes | |
int | year |
int | month |
int | day |
int | hour |
int | min |
int | sec |
It allows you to getCurrentTime, setTime, setDate, check which time is earlier, greater or equal.
StTime::StTime | ( | ) | [inline] |
StTime::StTime | ( | time_t | time | ) |
void StTime::clear | ( | ) | [inline] |
Set all variables to 0.
int StTime::diffrence | ( | StTime | time | ) | [inline] |
Calculate the diffrence between the time passed by argument and the time stored by class.
bool StTime::equal | ( | const StTime & | otherTime | ) |
Compare the time stored by class with the time passed by argument.
otherTime | - time to compare |
StTime StTime::getCurrentTime | ( | ) | [static] |
Get the current time
int StTime::getDay | ( | ) | const [inline] |
Get the day.
int StTime::getHour | ( | ) | const [inline] |
Get the hour.
int StTime::getMin | ( | ) | const [inline] |
Get the minute.
int StTime::getMonth | ( | ) | const [inline] |
Get the month.
int StTime::getSec | ( | ) | const [inline] |
Get the second.
time_t StTime::getTime | ( | ) |
Get the time stored by class.
int StTime::getYear | ( | ) | const [inline] |
Get the year.
bool StTime::greaterThan | ( | const StTime & | otherTime | ) |
Compare the time stored by class with the time passed by argument.
otherTime | - time to compare |
void StTime::init | ( | ) | [inline, private] |
bool StTime::lowerThan | ( | const StTime & | otherTime | ) |
Compare the time stored by class with the time passed by argument.
otherTime | - time to compare |
bool StTime::operator< | ( | const StTime & | otherTime | ) | [inline] |
Same as lowerThan function
bool StTime::operator== | ( | const StTime & | otherTime | ) | [inline] |
Same as equal function
bool StTime::operator> | ( | const StTime & | otherTime | ) | [inline] |
Same as greaterThan function
void StTime::setDay | ( | int | day | ) | [inline] |
Set the day.
void StTime::setHour | ( | int | hour | ) | [inline] |
Set the hour.
void StTime::setMin | ( | int | minute | ) | [inline] |
Set the minute.
void StTime::setMonth | ( | int | month | ) | [inline] |
Set the month.
void StTime::setSec | ( | int | second | ) | [inline] |
Set the second.
void StTime::setTime | ( | tm * | time | ) |
void StTime::setTime | ( | time_t | time | ) |
void StTime::setTime | ( | int | year, | |
int | month, | |||
int | day, | |||
int | hour, | |||
int | minute, | |||
int | second | |||
) | [inline] |
void StTime::setYear | ( | int | year | ) | [inline] |
Set the year.
int StTime::day [private] |
int StTime::hour [private] |
int StTime::min [private] |
int StTime::month [private] |
int StTime::sec [private] |
int StTime::year [private] |