Library /sys$common/syshlp/helplib.hlb  —  DECdts  utc_mkasctime
    Converts a null-terminated character string that represents an
    absolute time to a binary timestamp.

    Format

      #include <utc.h>

      int utc_mkasctime(*utc, *string)

         utc_t *utc;
         char *string;

1  –  Parameters

    Input

 string

    A null-terminated string that expresses an absolute time.

    Output

 utc

    Resulting binary timestamp.

2  –  Description

    The Make ASCII Time routine converts a null-terminated string
    that represents an absolute time to a binary timestamp.

3  –  Notes

    The ASCII string must be null-terminated.

4  –  Returns

     0   Indicates that the routine executed successfully.
    -1   Indicates an invalid time parameter or invalid results.

5  –  Example

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

    utc_t     utc;
    char      str[UTC_MAX_STR_LEN];

    /*
     *   July 4, 1776, 12:01:37.223 local time
     *   TDF of -5:00 hours
     *   Inaccuracy of 3600.32 seconds
     */

    (void)strcpy((void *)str,
                 "1776-07-04-12:01:37.223-5:00 I 3600.32");

    utc_mkasctime(&utc,    /* Out: Binary utc            */
                  str);    /* In:  String                */

6  –  Related Functions

    utc_ascanytime, utc_ascgmtime, utc_asclocaltime
Close Help