Gets the operating system date
| Call | |
| #include <vv_sys.h> | |
| int date_get(date_stp, format_stp) | |
|
UCHAR *date_stp |
String to receive formatted date |
| UCHAR *format_stp | Date format string |
| Description of Parameters
format_stp: Specify SYSDATEFMT (the global system date format), US_DATE ("MM/DD/YY"), EURO_DATE ("DD/MM/YY"), or your own date format string. A date format string is composed of the following characters: |
|
| D | Represents numeric day (i.e., 22). There can only be 2 Ds in the string. |
| M | Represents numeric month (i.e., 12). There can only be 2 Ms in the string. |
| S | Represents the string month (i.e., Mar or March depending on the number of Ss). There must be at least three Ss in the string so that the month can be uniquely specified. |
| Y | Represents the numeric year. There can be 2 or 4 Ys in the string |
| Any other character, including spaces, may be used as separators between the components. The separators are optional. | |
| Returns | |
| 1 | A valid, formatted date string was placed in the destination string |
| 0 | An invalid date was generated |
| Description
date_get() gets the date components (day, month, and year) from the operating system. For PCDOS systems, the PCDOS interrupt GET_DATE (AH = 2A) is used. For OS/2 systems, the DosGetDateTime() system service is used. For TERMINAL systems, the time() and localtime() system services are used. The date components are then formatted according to the specified format string using date_frnums(). The resulting date string is placed in the string pointed to in the call. |
|
| Related Functions | |
| Cautions
The string must be large enough to hold the formatted date string, including date separators and a null terminator '\0'. An invalid date (zero return) is not considered a fatal error. VV_ERR does not get set; therefore, the VCS error reporting system does not report this condition. |
|