Compartir a través de


Two-Digit and Four-Digit Dates (Windows CE 5.0)

Send Feedback

All Windows CE functions and external interfaces represent a year with four digits, for example 2020. The OEM is responsible for storing a compressed date in the OEM adaptation layer (OAL) so that it passes the correct date to the hardware. This compressed date can have up to a 100-year range, for example 1950 to 2049.

Windows CE does not have any inherit logic for converting two-digit dates to four-digit dates. OLE functions convert all two-digit dates ending in 29 or less to twenty-first century dates; they will convert all two-digit dates ending in 30 or more to twentieth century dates. For example, OLE will convert 29 to 2029, and it will convert 30 to 1930. OLE internal functions use four-digit dates; they only convert two-digit dates to four-digit dates when an application supplies a two-digit date string to an OLE function. OLE conversions do not affect the date information used by the OS.

You can use the real-time clock functions to make sure that your OS design handles dates properly. Use GetSystemTime, SetSystemTime, and CeSetUserNotification to set, and then retrieve, various twentieth-century and twenty-first century dates. Because these functions call the OAL real-time clock functions, OEMSetRealTime, OEMGetRealTime, and OEMSetAlarmTime provide a good test of your OS design's ability to handle various dates.

See Also

Additional Kernel Functionality

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.