asctime
- Updated2023-02-21
- 1 minute(s) read
asctime
char *asctime (const struct tm *timeStruct);
Purpose
Takes a date and time stored in a struct tm and converts it into a string. asctime returns a pointer to the string created by the function. You can obtain the local date and time in a struct tm by calling one of the following functions:
![]() |
Note Per the C89 specification, this function and the ctime function return a pointer to the same static array of char. Using these functions in conjunction with each other might result in overwriting the previous value of the timeString parameter. For more information about the C89 specification, refer to an external C89 reference. |
Parameters
Input | ||
Name | Type | Description |
timeStruct | const struct tm * | Contains the address of a struct tm representing a date and time. |
Return Value
Name | Type | Description |
timeString | char * |
Contains a pointer to the string created from the date and time stored in
timeStruct. The string appears in the
following form:
Sun Apr 12 05:28:07 1973\n\0 |
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later