tibrvMsgDateTime

Type

Declaration

typedef struct
{
    tibrv_i64     sec;
    tibrv_u32     nsec;
} tibrvMsgDateTime;

Purpose

Represents dates and times.

Accessor

Description

sec

Signed 64-bit integer representing seconds.

nsec

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.

Converting Dates 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.

Representations

Rendezvous software represents time values in two ways—one within 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.

Date and Time Representations

Representation

Details

Within 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— TIBRVMSG_DATETIME_SEC_MAX and TIBRVMSG_DATETIME_SEC_MIN.

range in years

292,471,208,677

range in seconds

9,223,372,036,854,775,807

restricted range in seconds

549,755,813,887

restricted range in millisecs

549,755,813,887,000

Rendezvous wire format

Seconds as a 40-bit signed integer, plus microseconds as a 24-bit unsigned integer.

range in years

17,432

range in seconds

549,755,813,887

range in milliseconds

549,755,813,887,000

See Also

Add DateTime

tibrvMsg_ConvertToString()

tibrvMsg_GetCurrentTime()

Get DateTime

Update DateTime