Share this page

# ctime

Date and Time Functions

Converts the system time to local time.

    char *ctime( const time_t *calTime);

calTime | The name of the value for the calendar time.

Under Linux, ctime is not thread-safe. Use ctime_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 prints out the system time. It then prints the same time value in Linux-style format using ctime.

Copy code

        #include <time.h>
        // Get Linux-style time and display as number and string
        lr_message ("Time in seconds since 1/1/70: %ld\n", time(&t));
        lr_message ("Linux-style time and date: %s", ctime(&t));

    Example: Output:
    Time in seconds since 1/1/70: 1019382960
    Linux-style time and date: Sun Apr 21 11:56:00 2002

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