Internationalization and localization tools


Locale-Sensitive Windows C++ Date/Time Method

BOOL ParseDateTime(LPCTSTR lpszDate, DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT);

Internationalization (I18n) Method Overview

This method parses a string to read a date/time value. If the string was successfully converted to a date/time value, the value of this COleDateTime object is set to that value and its status to valid.

This method is part of the COleDateTime class. For more information on this and other COleDateTime methods see the MSDN Library.

I18n Issues

This method needs to be examined in detail to see if it is adequate for an internationalized application. This is quite dependent on where the string that is being parsed came from.

For example, if the string is a canonical form of date/time that is locale-independent, you may want to use an constant LCID as a parameter. This could happen possibly if an application has strings stored in a canonical form in a database, or uses a protocol that has a locale-independent string format.

Another example, if the string was created by an earlier call in the application to strftime or COleDateTime.Format, then you will have to be aware of the format string or LCID respectively, that was used in that previous call so the proper LCID can be used to parse the resulting string with COleDateTime.Format later.

Locale-Sensitive Windows C++ Methods

 

Lingoport internationalization and localization services and software