PreviousNext

utc_mkascreltime(3dts)

Converts a NULL-terminated character string that represents a relative timestamp to a binary timestamp

Synopsis

#include <dce/utc.h>

int utc_mkascreltime(
utc_t *utc,
char *
string);

Parameters

Input

string
A NULL-terminated string that expresses a relative timestamp in its ISO format.

Output

utc
Resulting binary timestamp.

Description
The utc_mkascreltime( ) routine converts a NULL-terminated string, which represents a relative timestamp, to a binary timestamp.

Notes
The ASCII string must be NULL-terminated.

Return Values
~0 Indicates that the routine executed successfully.

1 Indicates an invalid time parameter or invalid results.

Examples
The following example converts an ASCII relative time string to its binary equivalent.

utc_t utc;
char str[UTC_MAX_STR_LEN];
/* Relative time of -333 days, 12 hours, 1 minute, 37.223 seconds
* Inaccuracy of 50.22 seconds in the format: -333-12:01:37.223I50.22
*/
(void)strcpy((void *)str,
"-333-12:01:37.223I50.22");
utc_mkascreltime(&utc, /* Out: Binary utc */
str); /* In: String */

Related Information
Function: utc_ascreltime( )