VMS Help
DECdts, utc_mkascreltime
*Conan The Librarian
|
Converts a null-terminated character string that represents a
relative timestamp to a binary timestamp.
Format
#include <utc.h>
int utc_mkascreltime(*utc, *string)
utc_t *utc;
char *string;
Input
string
A null-terminated string that expresses a relative timestamp in
its ISO format.
Output
utc
Resulting binary timestamp.
The Make ASCII Relative Time routine converts a null-terminated
string, which represents a relative timestamp, to a binary
timestamp.
The ASCII string must be null-terminated.
0 Indicates that the routine executed successfully.
-1 Indicates an invalid time parameter or invalid results.
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 sec. 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 */
utc_ascreltime