Open topic with navigation

TIBCO Rendezvous® 8.7.0

# 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
`TibrvMsgDateTime()` | Create a Rendezvous datetime object.

Member | Type | Description
`sec` | `tibrv_i64` | Signed 64-bit integer representing seconds.
`nsec` | `tibrv_u32` | 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 `tibrvMsgDateTime` objects. Return `TIBRV_TRUE` if the two objects represent the same time; `TIBRV_FALSE` otherwise.
`!=` | Test inequality. Operands can be any combination of C++ TibrvMsgDateTime objects and C `tibrvMsgDateTime` objects. Return `TIBRV_FALSE` if the two objects do not represent the same time; `TIBRV_TRUE` otherwise.

## 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.

Date and Time Representations

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— `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`

## 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

Add DateTime

TibrvMsg::convertToString()

Get DateTime

Update DateTime

tibrvMsgDateTime in TIBCO Rendezvous C Reference

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.