C Driver API 3.0.0
API for the NuoDB C Driver Library
Loading...
Searching...
No Matches
NuoDB_Temporal Struct Reference

Data structure used to represent temporal information. More...

#include <temporal.h>

Data Fields

int64_t(* getMilliSeconds )(NuoDB_Temporal *_this)
 Return the value of the corresponding NuoDB_Temporal data structure as milliseconds.
 
int32_t(* getNanoSeconds )(NuoDB_Temporal *_this)
 Return the value of the fractional part of the corresponding NuoDB_Temporal data structure as nanoseconds.
 
NuoDB_Status(* getTimestamp )(NuoDB_Temporal *_this, struct tm *utc_time)
 Populate the utc_time struct with the value from this timestamp based on the UTC time zone (versus the local time zone).
 
NuoDB_Status(* getTimestampNuoDBTimezone )(NuoDB_Temporal *_this, const NuoDB_Timezone *timeZone, struct tm *tz_time)
 Populate the tm time struct with the value from this timestamp based on the time zone being passed in.
 
NuoDB_Status(* getTimestampTZ )(NuoDB_Temporal *_this, const char *timeZoneId, struct tm *tz_time)
 Populate the tm time struct with the value from this timestamp based on the time zone being passed in.
 
int(* getType )(NuoDB_Temporal *_this)
 Return the SQL type for the NuoDB_Temporal data structure.
 
int64_t milliseconds
 
int32_t nanoseconds
 
void(* setMilliSeconds )(NuoDB_Temporal *_this, int64_t millis)
 Set the NuoDB_Temporal data structure with the specified number of milliseconds.
 
void(* setNanoSeconds )(NuoDB_Temporal *_this, int32_t nanos)
 Set the fractions of a second in the NuoDB_Temporal data structure with the specified number of nanoseconds.
 
NuoDB_Status(* setTimestamp )(NuoDB_Temporal *_this, struct tm *utc_time)
 Set this timestamp from the time specified in utc_time.
 
NuoDB_Status(* setTimestampNuoDBTimezone )(NuoDB_Temporal *_this, const NuoDB_Timezone *timeZone, struct tm *tz_time)
 Set this timestamp from the time specified in tz_time using the time zone being passed in.
 
NuoDB_Status(* setTimestampTZ )(NuoDB_Temporal *_this, const char *timeZoneId, struct tm *tz_time)
 Set this timestamp from the time specified in tz_time using the time zone being passed in.
 
NuoDB_Temporal_Type type
 

Detailed Description

Data structure used to represent temporal information.

The NuoDB_Temporal data structure can be used to store and retrieve any NuoDB Temporal information (SQL DATE, SQL TIME, SQL TIMESTAMP or SQL TIMESTAMP WITHOUT TIME ZONE).

Field Documentation

◆ getMilliSeconds

int64_t(* NuoDB_Temporal::getMilliSeconds) (NuoDB_Temporal *_this)

Return the value of the corresponding NuoDB_Temporal data structure as milliseconds.

The milliseconds returned will be UTC milliseconds since the common (UNIX) epoch, Jan 1, 1970.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
the number of milliseconds in the SQL TIMESTAMP

◆ getNanoSeconds

int32_t(* NuoDB_Temporal::getNanoSeconds) (NuoDB_Temporal *_this)

Return the value of the fractional part of the corresponding NuoDB_Temporal data structure as nanoseconds.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
the number of nanoseconds in the fraction of seconds in the NuoDB_Temporal data structure.

◆ getTimestamp

NuoDB_Status(* NuoDB_Temporal::getTimestamp) (NuoDB_Temporal *_this, struct tm *utc_time)

Populate the utc_time struct with the value from this timestamp based on the UTC time zone (versus the local time zone).

Parameters
[in]_thisa pointer to the current (this) data structure.
[out]utc_timeC standard tm time struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

◆ getTimestampNuoDBTimezone

NuoDB_Status(* NuoDB_Temporal::getTimestampNuoDBTimezone) (NuoDB_Temporal *_this, const NuoDB_Timezone *timeZone, struct tm *tz_time)

Populate the tm time struct with the value from this timestamp based on the time zone being passed in.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]timeZonepointer to an initialized timezone
[out]tm_timeC standard tm time struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

◆ getTimestampTZ

NuoDB_Status(* NuoDB_Temporal::getTimestampTZ) (NuoDB_Temporal *_this, const char *timeZoneId, struct tm *tz_time)

Populate the tm time struct with the value from this timestamp based on the time zone being passed in.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]timeZoneIdNuoDB uses ICU for timezone conversions. timezoneId is an id for a time zone, such as "America/Los_Angeles", or a custom ID such as "GMT-8:00". It is passed as an argument to icu::TimeZone::createTimeZone().
[out]tm_timeC standard tm time struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

◆ getType

int(* NuoDB_Temporal::getType) (NuoDB_Temporal *_this)

Return the SQL type for the NuoDB_Temporal data structure.

The NuoDB_Temporal data structure can be used to store and retrieve a SQL DATE, SQL TIME, SQL TIMESTAMP or SQL TIMESTAMP WITHOUT TIME ZONE. This function returns the SQL type.

Parameters
[in]_thisa pointer to the current (this) data structure.
Returns
the SQL type.

◆ setMilliSeconds

void(* NuoDB_Temporal::setMilliSeconds) (NuoDB_Temporal *_this, int64_t millis)

Set the NuoDB_Temporal data structure with the specified number of milliseconds.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]millisa 64-bit integer specifying the number of milliseconds since the common (UNIX) epoch, January 1, 1970

◆ setNanoSeconds

void(* NuoDB_Temporal::setNanoSeconds) (NuoDB_Temporal *_this, int32_t nanos)

Set the fractions of a second in the NuoDB_Temporal data structure with the specified number of nanoseconds.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]nanosa 32-bit integer specifying the fractional part of one second in nanoseconds.

◆ setTimestamp

NuoDB_Status(* NuoDB_Temporal::setTimestamp) (NuoDB_Temporal *_this, struct tm *utc_time)

Set this timestamp from the time specified in utc_time.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]utc_timeC standard tm struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

◆ setTimestampNuoDBTimezone

NuoDB_Status(* NuoDB_Temporal::setTimestampNuoDBTimezone) (NuoDB_Temporal *_this, const NuoDB_Timezone *timeZone, struct tm *tz_time)

Set this timestamp from the time specified in tz_time using the time zone being passed in.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]timeZonepointer to an initialized timezone
[in]tz_timeC standard tm struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

◆ setTimestampTZ

NuoDB_Status(* NuoDB_Temporal::setTimestampTZ) (NuoDB_Temporal *_this, const char *timeZoneId, struct tm *tz_time)

Set this timestamp from the time specified in tz_time using the time zone being passed in.

Parameters
[in]_thisa pointer to the current (this) data structure.
[in]timeZoneIdNuoDB uses ICU for timezone conversions. timezoneId is an id for a time zone, such as "America/Los_Angeles", or a custom ID such as "GMT-8:00". It is passed as an argument to icu::TimeZone::createTimeZone().
[in]tz_timeC standard tm struct (<time.h>)
Returns
Enumerated integer NuoDB_Status. NUODB_SUCCESS (integer 0) on success, or a negative integer on failure.

The documentation for this struct was generated from the following file: