Vault  4.1
Public Member Functions | Static Public Member Functions | Friends
VTimeOfDay Class Reference

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>

List of all members.

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 VCodePointgetLocalTimeSeparator ()
 Returns the time separator for the locale.

Friends

bool operator== (const VTimeOfDay &t1, const VTimeOfDay &t2)

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
timeZoneIDspecifies 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.

Parameters:
hourthe hour of day (0 to 23)
minutethe minute of the hour (0 to 59)
secondthe second of the minute (0 to 59)
millisecondthe millisecond of the second (0 to 999)

Definition at line 1217 of file vinstant.cpp.

References ASSERT_INVARIANT.


Member Function Documentation

int VTimeOfDay::getHour ( ) const

Returns the hour of day.

Returns:
the hour (0 to 23)

Definition at line 1232 of file vinstant.cpp.

References ASSERT_INVARIANT.

int VTimeOfDay::getMinute ( ) const

Returns the minute of the hour.

Returns:
the minute (0 to 59)

Definition at line 1238 of file vinstant.cpp.

References ASSERT_INVARIANT.

int VTimeOfDay::getSecond ( ) const

Returns the second of the minute.

Returns:
the second (0 to 59)

Definition at line 1244 of file vinstant.cpp.

References ASSERT_INVARIANT.

int VTimeOfDay::getMillisecond ( ) const

Returns the millisecond of the second.

Returns:
the second (0 to 999)

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.

Parameters:
hourthe hour of day (0 to 23)
minutethe minute of the hour (0 to 59)
secondthe second of the minute (1 to 59)
millisecondthe 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.

Parameters:
hourthe 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.

Parameters:
minutethe 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.

Parameters:
secondthe 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.

Parameters:
millisecondthe 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.)

Returns:
the time separator character constant

Definition at line 1191 of file vinstant.h.


The documentation for this class was generated from the following files:

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.