TibrvMsgDateTime
Class
Declaration
class TibrvDateTime
: public tibrvMsgDateTime
Purpose
Represent date and time.
Remarks
Because the datetime object is identical to the C field struct, programs can use the struct’s accessors to get and set the field’s sec
and nsec
members.
Although a formal destructor is not needed, C++ declares a default destructor, which has no effect.
Method |
Description |
Member |
Type |
Description |
|
|
Signed 64-bit integer representing seconds. |
|
Unsigned 32-bit integer representing nanoseconds after the seconds value. This value is always non-negative, between zero and 999999999. It modifies the date in whole seconds by specifying the number of nanoseconds after that date. For example, the time 1/2 second before midnight of December 31, 1969 is -1 seconds plus 500,000,000 nanoseconds. |
Operator |
Description |
|
Test equality. Operands can be any combination of C++ TibrvMsgDateTime objects and C Return |
|
Test inequality. Operands can be any combination of C++ TibrvMsgDateTime objects and C Return |
Representations
Rendezvous software represents time values in two ways—one within C and C++ programs, and a more compact wire format within messages. Date and Time Representations compares these two representations. In both representations, zero denotes the epoch, 12:00 midnight, January 1st, 1970. Range limits denote the extreme value on either side of that center. Bold type indicates the primary unit of measurement for each representation.
Representation |
Details |
|
Within C and C++ programs |
Seconds as a 64-bit signed integer, plus nanoseconds as a 32-bit unsigned integer. However, values are restricted to the range and granularity supported by Rendezvous wire format. Forcing larger or finer values into this representation produces an error. Two constants bracket the available (restricted) range of values within programs— |
|
range in years |
|
|
range in seconds |
|
|
restricted range in seconds |
|
|
restricted range in millisecs |
|
|
Rendezvous wire format |
Seconds as a 40-bit signed integer, plus microseconds as a 24-bit unsigned integer. |
|
range in years |
|
|
range in seconds |
|
|
range in milliseconds |
|
Converting DateTime to Strings
TibrvMsg::convertToString() prints times in UTC format (also known as Zulu time or GMT). The ISO-8601 standard requires appending a Z
character in this notation.
TibrvMsg::convertToString() uses Common Era numbering for years. This system does not include a year zero. So for example, the time 1 second before 0001-01-01 00:00:00Z
would print as -0001-12-31 23:59:59Z
.
TibrvMsg::convertToString() uses a proleptic Gregorian calendar. That is, when formatting dates earlier than the adoption of the Gregorian calendar, it projects the Gregorian calendar backward beyond its actual invention and adoption.
See Also
tibrvMsgDateTime in