Gets the system time
| Call | ||
| #include <vv_sys.h> | ||
| int time_get(time_stp, format_stp) | ||
|
UCHAR *time_stp |
String to receive formatted time |
|
| UCHAR *format_stp | Pointer to format string | |
| format_stp: Specify SYSTIMEFMT or a time format string of your own creation. A time format string is composed of the following characters: | ||
| H | Represents hours. There can be from 2 to 6 Hs in the string. | |
| M | Represents minutes. There can only be 2 Ms in the string. | |
| S | Represents seconds. There can only be 2 Ss in the string. | |
| am | Indicates that a 12-hour clock should be used and "am" will be appended for times less than noon and "pm" will be appended for times after noon. | |
| Any other characters may be used as separators between the components. The separators are optional. The maximum number of separators is 2 for the 24- hour clock and 3 for the 12-hour clock. If present, the separators will be copied into the destination time string. | ||
| Returns | ||
| 1 | A valid, formatted time string is placed in the destination. | |
| 0 | An invalid time was received from the operating system. | |
| Description
time_get() gets the time from the operating system. For PCDOS systems, the DOS interrupt GET_TIME (AH = 2C) is used. For OS/2 systems, the DosGetDateTime() system service is used. For TERMINAL systems, the time() and localtime() system services are used. |
||
| Related Functions | ||
| Cautions
The string must be large enough to hold the formatted time string, including the null terminator '/0'. An invalid time (0 return) is not considered a fatal error. VV_ERR is not set; therefore, the VCS error reporting system does not report this condition. |
||