Article ID: 826556 - Last Review: November 26, 2007 - Revision: 1.2 BUG: Date formats that contain 'gg' for Emperor Era year are not formatted correctly with the COleDateTime class when you set the locale to Japanese on a computer that is running Windows 2000
On This PageSYMPTOMSIn Regional options, you set the Date to Japanese, and you set the Long date format to gg yy 'Year' MM 'Month' dd 'Date' on a computer that is running Microsoft Windows 2000 where Year, Month, and Date are in Japanese. When the COleDateTime class is used to output the date, the year that is displayed remains "2004" instead of the Japanese Emperor year "16."
CAUSEThis problem is caused by a bug in the strftime and VarBstrFromDate functions that format the date. These low-level functions cause the COleDateTime class to fail. WORKAROUNDTo work around this problem in Windows 2000, use the Win32 API GetDateFormat funtion. The GetDateFormat function correctly formats the Japanese Emperor Era year. To do this, replace the code in the CMainFrame::CMainFrame() function with the following code: STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This bug was corrected in Microsoft Windows XP.
MORE INFORMATIONNote Before you follow the steps to reproduce the behavior, set your Regional options on a computer that is running Windows 2000 to the settings that are described in the "Symptoms" section. To do this, follow these steps:
Steps to reproduce the behavior
ResultA dialog box appears that contains the following:Note x is a placeholder for a Japanese character.Expected resultA dialog box appears that contains the following: Note x is a placeholder for a Japanese character.REFERENCESFor more information about how to develop Web-based solutions for Internet Explorer, visit the following Microsoft Developer Network (MSDN) Web sites:
GetDateFormat
http://msdn2.microsoft.com/en-us/library/ms776293.aspx (http://msdn2.microsoft.com/en-us/library/ms776293.aspx) COleDateTime
http://msdn2.microsoft.com/en-us/library/38wh24td(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/38wh24td(vs.71).aspx) | Other Resources Other Support Sites
CommunityArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top