Time Helper Functions
[C Runtime Common Functions]

Functions

int rtMakeGeneralizedTime (OSCTXT *pctxt, const OSNumDateTime *dateTime, char **outdata, size_t outdataSize)
int rtMakeUTCTime (OSCTXT *pctxt, const OSNumDateTime *dateTime, char **outdata, size_t outdataSize)
int rtParseGeneralizedTime (OSCTXT *pctxt, const char *value, OSNumDateTime *dateTime)
int rtParseUTCTime (OSCTXT *pctxt, const char *value, OSNumDateTime *dateTime)
void normalizeTimeZone (OSNumDateTime *pvalue)

Detailed Description

Utility functions for working with time strings in different formats. rtMake* functions create time strings, rtParse* functions parse time strings into the C OSNumDateTime structure defined in osSysTypes.h. Implementations of these functions exist for the ASN.1 GeneralizedTime and UTCTime formats.


Function Documentation

void normalizeTimeZone ( OSNumDateTime *  pvalue  ) 

This function normalizes the time zone for the given datetime structure.

Parameters:
pvalue A pointer-to an OSNumDateTime structure.
int rtMakeGeneralizedTime ( OSCTXT pctxt,
const OSNumDateTime *  dateTime,
char **  outdata,
size_t  outdataSize 
)

This function creates a time string in ASN.1 GeneralizedTime format as specified in the X.680 ITU-T standard.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
dateTime A pointer to a date/time structure that contains components of the date and time.
outdata A pointer to a pointer to a destination string. If outdataSize is non-zero, it should be a pointer to a pointer to an actual array. Otherwise, the memory will be allocated and the pointer will be stored in the outdata.
outdataSize A size of outdata (in octets). If zero, the memory for the outdata will be allocated. If not, the outdata 's size should be big enough to receive the generated time string. Otherwise, error code will be returned.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.
int rtMakeUTCTime ( OSCTXT pctxt,
const OSNumDateTime *  dateTime,
char **  outdata,
size_t  outdataSize 
)

This function creates a time string in ASN.1 UTCTime format as specified in the X.680 ITU-T standard.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
dateTime A pointer to a date/time structure that contains components of the date and time.
outdata A pointer to a pointer to a destination string. If outdataSize is non-zero, it should be a pointer to a pointer to an actual array. Otherwise, the memory will be allocated and the pointer will be stored in the outdata.
outdataSize A size of outdata (in octets). If zero, the memory for the outdata will be allocated. If not, the outdata 's size should be big enough to receive the generated time string. Otherwise, error code will be returned.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.
int rtParseGeneralizedTime ( OSCTXT pctxt,
const char *  value,
OSNumDateTime *  dateTime 
)

This function parses a time string that is represented in ASN.1 GeneralizedTime format as specified in the X.680 ITU-T standard. It stores the parsed result in a numeric date/time C structure.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
value A pointer to the time string to be parsed.
dateTime A pointer to the destination structure.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.
int rtParseUTCTime ( OSCTXT pctxt,
const char *  value,
OSNumDateTime *  dateTime 
)

This function parses a time string that is represented in ASN.1 UTCTime format as specified in the X.680 ITU-T standard. It stores the parsed result in a numeric date/time C structure.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
value A pointer to the time string to be parsed.
dateTime A pointer to the destination date/time structure.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.