Article ID: 177146 - Last Review: July 1, 2004 - Revision: 2.2 How To Read and Change the System Date with API FunctionsThis article was previously published under Q177146 SUMMARY
This article presents a step-by-step demonstration on programmatically
calling Windows application program interface (API) functions from Visual
FoxPro to read and set the system date. The code example shows how to
obtain the date in a short date format. The system date can be set manually
in the Date tab through the Regional Settings applet in the Windows Control
Panel.
MORE INFORMATION
The values passed to the GetLocaleInfo API are obtained from the file
Winnls.h that ships with Visual C. The Winnls.h contains constants and
declarations used for National Language Support for Windows applications.
Below are a few values from the Winnls.h file that may be useful in a
Visual FoxPro for Windows application.
Hexadecimal Value Description ------------------------------------------------------- 0x00000014 * Local monetary symbol. * 0x00000015 * International monetary symbol. * 0x00000016 * Monetary decimal separator. * 0x00000017 * Monetary thousand separator. * 0x0000001D * Date separator. * 0x0000001E * Time separator. * 0x0000001F * Short date format string. * 0x00000020 * Long date format string. * 0x0000002A * Long name for Monday. * 0x0000002B * Long name for Tuesday. * 0x0000002C * Long name for Wednesday. * 0x0000002D * Long name for Thursday. * 0x0000002E * Long name for Friday. * 0x0000002F * Long name for Saturday. * 0x00000030 * Long name for Sunday. * 0x00000031 * Abbreviated name for Monday. * 0x00000032 * Abbreviated name for Tuesday. * 0x00000033 * Abbreviated name for Wednesday.* 0x00000034 * Abbreviated name for Thursday. * 0x00000035 * Abbreviated name for Friday. * 0x00000036 * Abbreviated name for Saturday. * 0x00000037 * Abbreviated name for Sunday. * Windows stores two types of date formats, long and short. The program below demonstrates how to read and set the short date format. Create a program and add the following code: REFERENCES
Visual C++ Help, version 5.0; search on: "GetLocaleInfo," "SetLocaleInfo"
| Article Translations
|
Back to the top
