PreviousNext

utc_ascanytime(3dts)

Converts a binary timestamp to an ASCII string that represents an arbitrary time zone

Synopsis

#include <dce/utc.h>

int utc_ascanytime(
char *cp,
size_t
stringlen,
utc_t *
utc);

Parameters

Input

stringlen
The length of the cp buffer.

utc
Binary timestamp. Use NULL if you want this routine to use the current time for this parameter.

Output

cp
ASCII string that represents the time.

Description
The utc_ascanytime( ) routine converts a binary timestamp to an ASCII string that expresses a time. The TDF component in the timestamp determines the local time used in the conversion.

Return Values
~0 Indicates that the routine executed successfully.

1 Indicates an invalid time parameter or invalid results.

Examples
The following example converts a time to an ASCII string that expresses the time in the time zone where the timestamp was generated.

utc_t evnt;
char localTime[UTC_MAX_STR_LEN];
/*
* Assuming that evnt contains the timestamp to convert, convert
* the time to ASCII in the following format:
*
* 1991-04-01-12:27:38.37-8:00I2.00
*/
utc_ascanytime(localtime, /* Out: Converted time */
UTC_MAX_STR_LEN, /* In: Length of string */
&evnt); /* In: Time to convert */

Related Information
Functions:

utc_ascgmtime(3dts)

utc_asclocaltime(3dts)