XBinder  Version 2.6.x
Functions
Date/time conversion functions

These functions handle the conversion of date/time to and from various internal formats to XML schema standard string forms. More...

Functions

EXTERNRT int rtxDateToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a numeric date value consisting of individual date components (year, month, day) into XML schema standard format (CCYY-MM-DD). More...
 
EXTERNRT int rtxTimeToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a numeric time value consisting of individual time components (hour, minute, second, fraction-of-second, time zone) into XML schema standard format (HH:MM:SS[.frac][TZ]). More...
 
EXTERNRT int rtxDateTimeToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a numeric date/time value of all components in the OSNumDateTime structure into XML schema standard format (CCYY-MM-DDTHH:MM:SS[.frac][TZ]). More...
 
EXTERNRT int rtxGYearToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a gregorian year value to a string (CCYY). More...
 
EXTERNRT int rtxGYearMonthToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a gregorian year and month value to a string (CCYY-MM). More...
 
EXTERNRT int rtxGMonthToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a gregorian month value to a string (MM). More...
 
EXTERNRT int rtxGMonthDayToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a gregorian month and day value to a string (MM-DD). More...
 
EXTERNRT int rtxGDayToString (const OSNumDateTime *pvalue, OSUTF8CHAR *buffer, size_t bufsize)
 This function formats a gregorian day value to a string (DD). More...
 
EXTERNRT int rtxGetCurrDateTime (OSNumDateTime *pvalue)
 This function reads the system date and time and stores the value in the given OSNumDateTime structure variable. More...
 
EXTERNRT int rtxCmpDate (const OSNumDateTime *pvalue1, const OSNumDateTime *pvalue2)
 This function compares the date part of two OSNumDateTime structures and returns the result of the comparison. More...
 
EXTERNRT int rtxCmpDate2 (const OSNumDateTime *pvalue, OSINT32 year, OSUINT8 mon, OSUINT8 day, OSBOOL tzflag, OSINT32 tzo)
 This function compares the date part of OSNumDateTime structure and date components, specified as parameters. More...
 
EXTERNRT int rtxCmpTime (const OSNumDateTime *pvalue1, const OSNumDateTime *pvalue2)
 This function compares the time part of two OSNumDateTime structures and returns the result of the comparison. More...
 
EXTERNRT int rtxCmpTime2 (const OSNumDateTime *pvalue, OSUINT8 hour, OSUINT8 min, OSREAL sec, OSBOOL tzflag, OSINT32 tzo)
 This function compares the time part of OSNumDateTime structure and time components, specified as parameters. More...
 
EXTERNRT int rtxCmpDateTime (const OSNumDateTime *pvalue1, const OSNumDateTime *pvalue2)
 This function compares two OSNumDateTime structures and returns the result of the comparison. More...
 
EXTERNRT int rtxCmpDateTime2 (const OSNumDateTime *pvalue, OSINT32 year, OSUINT8 mon, OSUINT8 day, OSUINT8 hour, OSUINT8 min, OSREAL sec, OSBOOL tzflag, OSINT32 tzo)
 This function compares the OSNumDateTime structure and dateTime components, specified as parameters. More...
 
EXTERNRT int rtxParseDateString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a date value from a supplied string and sets the given OSNumDateTime argument to the decoded date value. More...
 
EXTERNRT int rtxParseTimeString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a time value from a supplied string and sets the given OSNumDateTime structure to the decoded time value. More...
 
EXTERNRT int rtxParseDateTimeString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a datetime value from a supplied string and sets the given OSNumDateTime to the decoded date and time value. More...
 
EXTERNRT int rtxParseGYearString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a gregorian year value from a supplied string and sets the year in the given OSNumDateTime to the decoded value. More...
 
EXTERNRT int rtxParseGYearMonthString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a gregorian year and month value from a supplied string and sets the year and month fields in the given OSNumDateTime to the decoded values. More...
 
EXTERNRT int rtxParseGMonthString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a gregorian month value from a supplied string and sets the month field in the given OSNumDateTime to the decoded value. More...
 
EXTERNRT int rtxParseGMonthDayString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a gregorian month and day value from a supplied string and sets the month and day fields in the given OSNumDateTime to the decoded values. More...
 
EXTERNRT int rtxParseGDayString (const OSUTF8CHAR *inpdata, size_t inpdatalen, OSNumDateTime *pvalue)
 This function decodes a gregorian day value from a supplied string and sets the day field in the given OSNumDateTime to the decoded value. More...
 
EXTERNRT int rtxMSecsToDuration (OSINT32 msecs, OSUTF8CHAR *buf, OSUINT32 bufsize)
 This function converts millisecs to a duration string with format "PnYnMnDTnHnMnS". More...
 
EXTERNRT int rtxDurationToMSecs (OSUTF8CHAR *buf, OSUINT32 bufsize, OSINT32 *msecs)
 This function converts a duration string to milliseconds. More...
 
EXTERNRT int rtxSetDateTime (OSNumDateTime *pvalue, struct tm *timeStruct)
 This function converts a structure of type 'struct tm' to an OSNumDateTime structure. More...
 
EXTERNRT int rtxSetLocalDateTime (OSNumDateTime *pvalue, time_t timeMs)
 This function converts a local date and time value to an OSNumDateTime structure. More...
 
EXTERNRT int rtxSetUtcDateTime (OSNumDateTime *pvalue, time_t timeMs)
 This function converts a UTC date and time value to an OSNumDateTime structure. More...
 
EXTERNRT int rtxGetDateTime (const OSNumDateTime *pvalue, time_t *timeMs)
 This function converts an OSNumDateTime structure to a calendar time encoded as a value of type time_t. More...
 
EXTERNRT OSBOOL rtxDateIsValid (const OSNumDateTime *pvalue)
 This function verifies that date members (year, month, day, timezone) of the OSNumDateTime structure contains valid values. More...
 
EXTERNRT OSBOOL rtxTimeIsValid (const OSNumDateTime *pvalue)
 This function verifies that time members (hour, minute, second, timezone) of the OSNumDateTime structure contains valid values. More...
 
EXTERNRT OSBOOL rtxDateTimeIsValid (const OSNumDateTime *pvalue)
 This function verifies that all members of the OSNumDateTime structure contains valid values. More...
 

Detailed Description

These functions handle the conversion of date/time to and from various internal formats to XML schema standard string forms.

Function Documentation

◆ rtxCmpDate()

EXTERNRT int rtxCmpDate ( const OSNumDateTime pvalue1,
const OSNumDateTime pvalue2 
)

This function compares the date part of two OSNumDateTime structures and returns the result of the comparison.

Parameters
pvalue1Pointer to OSNumDateTime structure.
pvalue2Pointer to OSNumDateTime structure.
Returns
Completion status of operation:
  • 0 Dates are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxCmpDate2()

EXTERNRT int rtxCmpDate2 ( const OSNumDateTime pvalue,
OSINT32  year,
OSUINT8  mon,
OSUINT8  day,
OSBOOL  tzflag,
OSINT32  tzo 
)

This function compares the date part of OSNumDateTime structure and date components, specified as parameters.

Parameters
pvaluePointer to OSNumDateTime structure.
yearYear (-inf..inf)
monMonth (1..12)
dayDay (1..31)
tzflagTRUE, if time zone offset is set (see tzo parameter).
tzoTime zone offset (-840..840).
Returns
Completion status of operation:
  • 0 Dates are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxCmpDateTime()

EXTERNRT int rtxCmpDateTime ( const OSNumDateTime pvalue1,
const OSNumDateTime pvalue2 
)

This function compares two OSNumDateTime structures and returns the result of the comparison.

Parameters
pvalue1Pointer to OSNumDateTime structure.
pvalue2Pointer to OSNumDateTime structure.
Returns
Completion status of operation:
  • 0 Dates are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxCmpDateTime2()

EXTERNRT int rtxCmpDateTime2 ( const OSNumDateTime pvalue,
OSINT32  year,
OSUINT8  mon,
OSUINT8  day,
OSUINT8  hour,
OSUINT8  min,
OSREAL  sec,
OSBOOL  tzflag,
OSINT32  tzo 
)

This function compares the OSNumDateTime structure and dateTime components, specified as parameters.

Parameters
pvaluePointer to OSNumDateTime structure.
yearYear (-inf..inf)
monMonth (1..12)
dayDay (1..31)
hourHour (0..23)
minMinutes (0..59)
secSeconds (0.0..59.(9))
tzflagTRUE, if time zone offset is set (see tzo parameter).
tzoTime zone offset (-840..840).
Returns
Completion status of operation:
  • 0 Dates are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxCmpTime()

EXTERNRT int rtxCmpTime ( const OSNumDateTime pvalue1,
const OSNumDateTime pvalue2 
)

This function compares the time part of two OSNumDateTime structures and returns the result of the comparison.

Parameters
pvalue1Pointer to OSNumDateTime structure.
pvalue2Pointer to OSNumDateTime structure.
Returns
Completion status of operation:
  • 0 Times are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxCmpTime2()

EXTERNRT int rtxCmpTime2 ( const OSNumDateTime pvalue,
OSUINT8  hour,
OSUINT8  min,
OSREAL  sec,
OSBOOL  tzflag,
OSINT32  tzo 
)

This function compares the time part of OSNumDateTime structure and time components, specified as parameters.

Parameters
pvaluePointer to OSNumDateTime structure.
hourHour (0..23)
minMinutes (0..59)
secSeconds (0.0..59.(9))
tzflagTRUE, if time zone offset is set (see tzo parameter).
tzoTime zone offset (-840..840).
Returns
Completion status of operation:
  • 0 Times are same
  • +1 First Date/Time is greater than second.
  • -1 First Date/Time is less than second.

◆ rtxDateIsValid()

EXTERNRT OSBOOL rtxDateIsValid ( const OSNumDateTime pvalue)

This function verifies that date members (year, month, day, timezone) of the OSNumDateTime structure contains valid values.

Parameters
pvaluePointer to OSNumDateTime structure to be checked.
Returns
Boolean result: true means data is valid.

◆ rtxDateTimeIsValid()

EXTERNRT OSBOOL rtxDateTimeIsValid ( const OSNumDateTime pvalue)

This function verifies that all members of the OSNumDateTime structure contains valid values.

Parameters
pvaluePointer to OSNumDateTime structure to be checked.
Returns
Boolean result: true means data is valid.

◆ rtxDateTimeToString()

EXTERNRT int rtxDateTimeToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a numeric date/time value of all components in the OSNumDateTime structure into XML schema standard format (CCYY-MM-DDTHH:MM:SS[.frac][TZ]).

Parameters
pvaluePointer to OSNumDateTime structure containing date/time components to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string.
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxDateToString()

EXTERNRT int rtxDateToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a numeric date value consisting of individual date components (year, month, day) into XML schema standard format (CCYY-MM-DD).

Parameters
pvaluePointer to OSNumDateTime structure containing date components to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is at least nine bytes long to hold the formatted date and a null-terminator character.
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxDurationToMSecs()

EXTERNRT int rtxDurationToMSecs ( OSUTF8CHAR *  buf,
OSUINT32  bufsize,
OSINT32 *  msecs 
)

This function converts a duration string to milliseconds.

In the case of a string prepended with a minus sign (-) the duration in milliseconds will have negative value.

Parameters
bufPointer to OSUTF8CHAR array.
bufsizeOSINT32 indicates the bufsize to be read.
msecsOSINT32 updated after calculation.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_TOOBIG). Return value is taken from rtxErrCodes.h header file

◆ rtxGDayToString()

EXTERNRT int rtxGDayToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a gregorian day value to a string (DD).

Parameters
pvaluePointer to OSNumDateTime structure containing day value to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string (in this case, at least 3 characters long).
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxGetCurrDateTime()

EXTERNRT int rtxGetCurrDateTime ( OSNumDateTime pvalue)

This function reads the system date and time and stores the value in the given OSNumDateTime structure variable.

Parameters
pvaluePointer to OSNumDateTime structure.
Returns
Completion status of operation:
  • 0 in case success
  • negative in case failure

◆ rtxGetDateTime()

EXTERNRT int rtxGetDateTime ( const OSNumDateTime pvalue,
time_t *  timeMs 
)

This function converts an OSNumDateTime structure to a calendar time encoded as a value of type time_t.

Parameters
pvalueThe pointed OSNumDateTime structure variable to be converted.
timeMsA pointer to time_t value to be set.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error.

◆ rtxGMonthDayToString()

EXTERNRT int rtxGMonthDayToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a gregorian month and day value to a string (MM-DD).

Parameters
pvaluePointer to OSNumDateTime structure containing month and day value to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string (in this case, at least 6 characters long).
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxGMonthToString()

EXTERNRT int rtxGMonthToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a gregorian month value to a string (MM).

Parameters
pvaluePointer to OSNumDateTime structure containing month value to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string (in this case, at least 3 characters long).
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxGYearMonthToString()

EXTERNRT int rtxGYearMonthToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a gregorian year and month value to a string (CCYY-MM).

Parameters
pvaluePointer to OSNumDateTime structure containing year and month value to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string (in this case, at least 8 characters long).
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxGYearToString()

EXTERNRT int rtxGYearToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a gregorian year value to a string (CCYY).

Parameters
pvaluePointer to OSNumDateTime structure containing year value to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string (in this case, at least 5 characters long).
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error

◆ rtxMSecsToDuration()

EXTERNRT int rtxMSecsToDuration ( OSINT32  msecs,
OSUTF8CHAR *  buf,
OSUINT32  bufsize 
)

This function converts millisecs to a duration string with format "PnYnMnDTnHnMnS".

In case of negative duration a minus sign is prepended to the output string

Parameters
msecsNumber of milliseconds.
bufOutput buffer to recieve formatted duration.
bufsizeOutput buffer size.
Returns
Completion status of operation: 0 successful are same -1 unsuccessul

◆ rtxParseDateString()

EXTERNRT int rtxParseDateString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a date value from a supplied string and sets the given OSNumDateTime argument to the decoded date value.

Parameters
inpdataDate string to be parsed/decoded as OSNumDateTime.
  • The format of date is CCYY-MM-DD
  • The value of CCYY is from 0000-9999
  • The value of MM is 01 - 12
  • The value of DD is 01 - XX (where XX is the Days in MM month in CCYY year)
inpdatalenFor decoding, consider inpdata string up to this length.
pvalueThe OSNumDateTime structure variable will be set to the decoded date value.
  • Only year, month,day value will be set.
  • The value of pvalue->year is in range 0 to 9999
  • The value of pvalue->mon is in range 1 to 12
  • The value of pvalue->day is in range 1 to XX
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseDateTimeString()

EXTERNRT int rtxParseDateTimeString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a datetime value from a supplied string and sets the given OSNumDateTime to the decoded date and time value.

Parameters
inpdataInput date/time string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe pointed OSNumDateTime structure variable will be set to the decoded date and time value.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseGDayString()

EXTERNRT int rtxParseGDayString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a gregorian day value from a supplied string and sets the day field in the given OSNumDateTime to the decoded value.

Parameters
inpdataInput string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe day field in the given OSNumDateTime variable will be set to the decoded value.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseGMonthDayString()

EXTERNRT int rtxParseGMonthDayString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a gregorian month and day value from a supplied string and sets the month and day fields in the given OSNumDateTime to the decoded values.

Parameters
inpdataInput string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe month and day fields in the given OSNumDateTime variable will be set to the decoded values.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseGMonthString()

EXTERNRT int rtxParseGMonthString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a gregorian month value from a supplied string and sets the month field in the given OSNumDateTime to the decoded value.

Parameters
inpdataInput string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe month field in the given OSNumDateTime variable will be set to the decoded value.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseGYearMonthString()

EXTERNRT int rtxParseGYearMonthString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a gregorian year and month value from a supplied string and sets the year and month fields in the given OSNumDateTime to the decoded values.

Parameters
inpdataInput string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe year and month fields in the given OSNumDateTime variable will be set to the decoded value.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseGYearString()

EXTERNRT int rtxParseGYearString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a gregorian year value from a supplied string and sets the year in the given OSNumDateTime to the decoded value.

Parameters
inpdataInput string to be parsed.
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe year field in the given OSNumDateTime structure variable will be set to the decoded value.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxParseTimeString()

EXTERNRT int rtxParseTimeString ( const OSUTF8CHAR *  inpdata,
size_t  inpdatalen,
OSNumDateTime pvalue 
)

This function decodes a time value from a supplied string and sets the given OSNumDateTime structure to the decoded time value.

Parameters
inpdataThe inpdata is a time string to be parsed/decoded as OSNumDateTime.
  • The format of date is hh:mm:ss.ss (1) or hh:mm:ss.ssZ (2) or hh:mm:ss.ss+HH:MM (3) or hh:mm:ss.ss-HH:MM (4)
  • The value of hh is from 00-23
  • The value of mm is 00 - 59
  • The value of ss.ss is 00.00 - 59.99
  • The value of HH:MM is 00.00 - 24.00
inpdatalenFor decoding, consider the inpdata string up to this length.
pvalueThe OSNumDateTime structure variable will be set to the decoded time value.
  • Only hour, min, sec value will be set.
  • The value of pvalue->hour is in range 0 to 23
  • The value of pvalue->mon is in range 0 to 59
  • The value of pvalue->day is in range 0 to 59.99
  • The value of pvalue->tz_flag is FALSE for format(1) otherwise TRUE
  • The value of pvalue->tzo is 0 for format(2) otherwise Calculation of pvalue->tzo for format (3),(4) is HH*60+MM
  • The value of pvalue->tzo is -840 <= tzo <= 840 for format(3),(4) otherwise
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error (RTERR_NOTINIT/RTERR_INVFORMAT/RTERR_BADVALUE). Return value is taken from rtxErrCodes.h header file

◆ rtxSetDateTime()

EXTERNRT int rtxSetDateTime ( OSNumDateTime pvalue,
struct tm *  timeStruct 
)

This function converts a structure of type 'struct tm' to an OSNumDateTime structure.

Parameters
pvalueThe pointed OSNumDateTime structure variable will be set to time value.
timeStructA pointer to tm structure to be converted.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error.

◆ rtxSetLocalDateTime()

EXTERNRT int rtxSetLocalDateTime ( OSNumDateTime pvalue,
time_t  timeMs 
)

This function converts a local date and time value to an OSNumDateTime structure.

Parameters
pvalueThe pointed OSNumDateTime structure variable will be set to time value.
timeMsA calendar time encoded as a value of type time_t.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error.

◆ rtxSetUtcDateTime()

EXTERNRT int rtxSetUtcDateTime ( OSNumDateTime pvalue,
time_t  timeMs 
)

This function converts a UTC date and time value to an OSNumDateTime structure.

Parameters
pvalueThe pointed OSNumDateTime structure variable will be set to time value.
timeMsA calendar time encoded as a value of type time_t. The time is represented as seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time (UTC).
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error.

◆ rtxTimeIsValid()

EXTERNRT OSBOOL rtxTimeIsValid ( const OSNumDateTime pvalue)

This function verifies that time members (hour, minute, second, timezone) of the OSNumDateTime structure contains valid values.

Parameters
pvaluePointer to OSNumDateTime structure to be checked.
Returns
Boolean result: true means data is valid.

◆ rtxTimeToString()

EXTERNRT int rtxTimeToString ( const OSNumDateTime pvalue,
OSUTF8CHAR *  buffer,
size_t  bufsize 
)

This function formats a numeric time value consisting of individual time components (hour, minute, second, fraction-of-second, time zone) into XML schema standard format (HH:MM:SS[.frac][TZ]).

Parameters
pvaluePointer to OSNumDateTime structure containing time components to be formatted.
bufferBuffer into which date is to be formatted. This is a fixed-sized buffer. The user must provide a buffer that is large enough to hold the formatted time string.
bufsizeSize of the buffer to receive the formatted date.
Returns
Completion status of operation:
  • 0(RT_OK) = success,
  • negative return value is error