TIBCO FTL®

Public Member Functions | Properties | List of all members
TIBCO.FTL.TibDateTime Class Reference

This class represents date and time values with large range and nanosecond precision. More...

Inheritance diagram for TIBCO.FTL.TibDateTime:

## Public Member Functions
int | CompareTo (object obj)
| Compares the current `TibDateTime` object with its argument. More...
void | Dispose ()
override bool | Equals (Object obj)
| Determine whether two TibDateTime objects represent the same value. More...
override int | GetHashCode ()
| Returns the hash code for this instance. More...
void | Set (long sec, long nsec)
| Modify a `TibDateTime` object by setting its seconds and nanoseconds components. More...
| TibDateTime ()
| Create a `TibDateTime` object denoting January 1, 1970, 00:00:00.000000000 GMT (that is, the epoch). More...
| TibDateTime (DateTime dt)
| Construct a new `TibDateTime` object so it represents a time equivalent to an existing `TibDateTime` object. More...
| TibDateTime (long sec, long nsec)
| Construct a new `TibDateTime` object by setting its seconds and nanoseconds components. More...
override String | ToString ()
| Return printable a string representation of this `TibDateTime` object. More...

## Properties
DateTime | Date`[get, set]`
| Programs can use this property to convert between `TibDateTime` and .NET DateTime representations. More...
long | Nanoseconds`[get]`
| Get the nanoseconds component of a `TibDateTime` object. More...
long | Seconds`[get]`
| Get the seconds component of a `TibDateTime` object. More...
long | Ticks`[get, set]`
| Get or set a `TibDateTime` object in ticks (100 nanosecond units). More...

## Detailed Description

This class represents date and time values with large range and nanosecond precision.

`TibDateTime` values combine two numeric components.

- The Seconds component represents whole seconds with up to 64 bits. Zero denotes the UNIX epoch – midnight entering January 1, 1970.
- The Nanoseconds component represents nanoseconds after the time that the Seconds component denotes. Although the struct stores this component in a signed 64-bit integer, this component is always non-negative, between zero and 999999999.

For example, the value -1 seconds plus 999,999,998 nanoseconds represents December 31, 1969, 2 nanoseconds before midnight (that is, 2 nanoseconds before the epoch).

## Constructor & Destructor Documentation

## ◆ TibDateTime() [1/3]

TIBCO.FTL.TibDateTime.TibDateTime | ( |  | ) |
| inline

Create a `TibDateTime` object denoting January 1, 1970, 00:00:00.000000000 GMT (that is, the epoch).

## ◆ TibDateTime() [2/3]

TIBCO.FTL.TibDateTime.TibDateTime | ( | long | sec,
|  | long | nsec
| ) |  |
| inline

Construct a new `TibDateTime` object by setting its seconds and nanoseconds components.

Parameters

  sec | Seconds. Positive values represent seconds since the epoch. Negative values represent seconds before the epoch.
  nsec | Nanoseconds after the time that the sec argument denotes; must be in the range [0, 999999999].

## ◆ TibDateTime() [3/3]

TIBCO.FTL.TibDateTime.TibDateTime | ( | DateTime | dt | ) |
| inline

Construct a new `TibDateTime` object so it represents a time equivalent to an existing `TibDateTime` object.

Parameters

  dt | The constructor copies this TibDateTime object.

## Member Function Documentation

## ◆ CompareTo()

int TIBCO.FTL.TibDateTime.CompareTo | ( | object | obj | ) |
| inline

Compares the current `TibDateTime` object with its argument.

and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameters

  obj | The method compares this object against the current instance.

Returns
  An integer that indicates the relative order of the objects being compared.
  - 1 when this instance is greater than (later than) the method's argument
  - 0 when this instance is equal to the method's argument
  - -1 when this instance is less than (earlier than) the method's argument

Exceptions

  ArgumentException | obj is not a `TibDateTime` object.

## ◆ Dispose()

void TIBCO.FTL.TibDateTime.Dispose | ( |  | ) |
| inline

## ◆ Equals()

override bool TIBCO.FTL.TibDateTime.Equals | ( | Object | obj | ) |
| inline

Determine whether two TibDateTime objects represent the same value.

Parameters

  obj | A TibDateTime object.

Returns
  `true` if obj is a `TibDateTime` object, and it has value the same value as this instance; otherwise, `false`.

## ◆ GetHashCode()

override int TIBCO.FTL.TibDateTime.GetHashCode | ( |  | ) |
| inline

Returns the hash code for this instance.

Returns
  A 32-bit signed integer hash code.

## ◆ Set()

void TIBCO.FTL.TibDateTime.Set | ( | long | sec,
|  | long | nsec
| ) |  |
| inline

Modify a `TibDateTime` object by setting its seconds and nanoseconds components.

Parameters

  sec | Seconds. Positive values represent seconds since the epoch. Negative values represent seconds before the epoch.
  nsec | Nanoseconds after the time that the sec argument denotes; must be in the range [0, 999999999].

Exceptions

  FTLInvalidArgumentException | The value supplied for nsec is not in the range [0, 999999999].

## ◆ ToString()

override String TIBCO.FTL.TibDateTime.ToString | ( |  | ) |
| inline

Return printable a string representation of this `TibDateTime` object.

Returns
  A string representing the `TibDateTime` value.

## Property Documentation

## ◆ Date

DateTime TIBCO.FTL.TibDateTime.Date
| get set

Programs can use this property to convert between `TibDateTime` and .NET DateTime representations.

`Get` converts the value of the `TibDateTime` object, returning a .NET DateTime value.

`Set` converts a .NET DateTime value, and stores the result in the `TibDateTime` object.

`TibDateTime` values can represent time with nanosecond precision, but .NET DateTime values represent time in ticks (which are units of 100 nanoseconds). The `Get` accessor of this property truncates the nanoseconds component down to whole ticks.

The value ranges of `TibDateTime` and .NET DateTime overlap, but are not identical. When a conversion would result in an out-of-range value, the accessor throws an exception.

## ◆ Nanoseconds

long TIBCO.FTL.TibDateTime.Nanoseconds
| get

Get the nanoseconds component of a `TibDateTime` object.

Nanoseconds are after the time that the `seconds` component denotes.

## ◆ Seconds

long TIBCO.FTL.TibDateTime.Seconds
| get

Get the seconds component of a `TibDateTime` object.

Seconds are relative to the epoch – namely, January 1, 1970, 00:00:00 GMT.

## ◆ Ticks

long TIBCO.FTL.TibDateTime.Ticks
| get set

Get or set a `TibDateTime` object in ticks (100 nanosecond units).