![]() |
Vault
4.1
|
VTimeOfDay represents a time of day without understanding about calendars or time zones; it is simply an hour/minute/second container. More...
#include <vinstant.h>
Public Member Functions | |
VTimeOfDay () | |
Constructs a time of day with all values set to zero, which is valid and means midnight (start of a day). | |
VTimeOfDay (const VString &timeZoneID) | |
Constructs a time of day from the current instant. | |
VTimeOfDay (int hour, int minute, int second, int millisecond) | |
Constructs a time of day from specified values. | |
virtual | ~VTimeOfDay () |
Destructor. | |
int | getHour () const |
Returns the hour of day. | |
int | getMinute () const |
Returns the minute of the hour. | |
int | getSecond () const |
Returns the second of the minute. | |
int | getMillisecond () const |
Returns the millisecond of the second. | |
void | set (int hour, int minute, int second, int millisecond) |
Sets the time of day from specified values. | |
void | setHour (int hour) |
Sets the hour of the day. | |
void | setMinute (int minute) |
Sets the minute of the hour. | |
void | setSecond (int second) |
Sets the second of the minute. | |
void | setMillisecond (int millisecond) |
Sets the millisecond of the second. | |
void | setToStartOfDay () |
Sets the hour, minute, second, and millisecond to zero. | |
Static Public Member Functions | |
static const VCodePoint & | getLocalTimeSeparator () |
Returns the time separator for the locale. | |
Friends | |
bool | operator== (const VTimeOfDay &t1, const VTimeOfDay &t2) |
VTimeOfDay represents a time of day without understanding about calendars or time zones; it is simply an hour/minute/second container.
Definition at line 1102 of file vinstant.h.
VTimeOfDay::VTimeOfDay | ( | const VString & | timeZoneID | ) |
Constructs a time of day from the current instant.
Throws an exception if you specify RTZ conversion and there is no converter installed.
timeZoneID | specifies which time zone the h/m/s should be given in |
Definition at line 1201 of file vinstant.cpp.
References ASSERT_INVARIANT, getHour(), getMillisecond(), getMinute(), getSecond(), and VInstant::getTimeOfDay().
VTimeOfDay::VTimeOfDay | ( | int | hour, |
int | minute, | ||
int | second, | ||
int | millisecond | ||
) |
Constructs a time of day from specified values.
hour | the hour of day (0 to 23) |
minute | the minute of the hour (0 to 59) |
second | the second of the minute (0 to 59) |
millisecond | the millisecond of the second (0 to 999) |
Definition at line 1217 of file vinstant.cpp.
References ASSERT_INVARIANT.
int VTimeOfDay::getHour | ( | ) | const |
Returns the hour of day.
Definition at line 1232 of file vinstant.cpp.
References ASSERT_INVARIANT.
int VTimeOfDay::getMinute | ( | ) | const |
Returns the minute of the hour.
Definition at line 1238 of file vinstant.cpp.
References ASSERT_INVARIANT.
int VTimeOfDay::getSecond | ( | ) | const |
Returns the second of the minute.
Definition at line 1244 of file vinstant.cpp.
References ASSERT_INVARIANT.
int VTimeOfDay::getMillisecond | ( | ) | const |
Returns the millisecond of the second.
Definition at line 1250 of file vinstant.cpp.
References ASSERT_INVARIANT.
void VTimeOfDay::set | ( | int | hour, |
int | minute, | ||
int | second, | ||
int | millisecond | ||
) |
Sets the time of day from specified values.
hour | the hour of day (0 to 23) |
minute | the minute of the hour (0 to 59) |
second | the second of the minute (1 to 59) |
millisecond | the millisecond of the second (0 to 999) |
Definition at line 1256 of file vinstant.cpp.
References setHour(), setMillisecond(), setMinute(), and setSecond().
void VTimeOfDay::setHour | ( | int | hour | ) |
Sets the hour of the day.
hour | the hour of day (0 to 23) |
Definition at line 1265 of file vinstant.cpp.
References ASSERT_INVARIANT.
void VTimeOfDay::setMinute | ( | int | minute | ) |
Sets the minute of the hour.
minute | the minute of the hour (0 to 59) |
Definition at line 1276 of file vinstant.cpp.
References ASSERT_INVARIANT.
void VTimeOfDay::setSecond | ( | int | second | ) |
Sets the second of the minute.
second | the second of the minute (1 to 59) |
Definition at line 1287 of file vinstant.cpp.
References ASSERT_INVARIANT.
void VTimeOfDay::setMillisecond | ( | int | millisecond | ) |
Sets the millisecond of the second.
millisecond | the millisecond of the second (0 to 999) |
Definition at line 1298 of file vinstant.cpp.
References ASSERT_INVARIANT.
static const VCodePoint& VTimeOfDay::getLocalTimeSeparator | ( | ) | [inline, static] |
Returns the time separator for the locale.
(Currently just returns a colon.)
Definition at line 1191 of file vinstant.h.