Share this page

# asctime

Date and Time Functions

Converts time from a structure to a string.

    char *asctime( const struct tm *tmTime);

tmTime | A time structure.

Under Linux, asctime is not thread-safe. Use asctime_r, instead. Refer to your platform-specific documentation for details.

## Return Values

A pointer to the string containing the date and time information in readable format.

## Example

The following example gets the time as a time_t structure and converts it to a tm structure, gmt, in Coordinated Universal Time. asctime then takes gmt and converts it to a string.

        #include <time.h>

        time_t t;

        struct tm *gmt;

        time(&t);

        gmt = (struct tm *)gmtime(&t);

        lr_message ("Coordinated universal time:\t\t%s", asctime(gmt));

    Example:
    				Output:
    Coordinated universal time:        Sun Apr 21 15:31:06 2002

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: