Extending the Windows Japanese Calendar Era information.

Some people have asked whether Windows supports new Japanese Calendar Emperor eras if that becomes necessary.  FWIW That information is stored in the registry on Win7/Win8/.Net4.0+:   HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCalendarsJapaneseEras There are string values for each of the supported eras.  Each value is named with the start date of the era in yyyy MM dd format, such…

4

Short Date Formats Don’t Always Fit Neat Patterns

I’m often asked something like “What’s the date separator  for locale XXX?”  Well, not every locale fits our preconceived MM/dd/yyyy concepts.  Some of the built-in values that developers may not expect: dd/MM yyyy — 20/10 2010 — This one has different separators (space and /) so you tell me which one DateTimeFormatInfo.DateSeparator is supposed to use?…

5

Japanese Calendars, How do I Test Support for Additional Eras?

The Japanese Calendar is labeled by the reign of the current emporer.  Windows has supported 4 Japanese calendar Eras, however in the future there may be more eras.  Realizing this, we’ve added support in Windows 7, Server 2008R2 & .Net v4 for additional Japanese Eras. There’re a few things applications should know about extended Japanese…

4

DateTime.Parse() and DateTime.TryParse() fail in some cases

DateTime.Parse and DateTime.TryParse fail in .Net 2.0 if the user locale date override has a space in it.  Ie: if its something like “M d yyyy”.  .Net is getting tripped up over the space (we’re working on a fix for SP1/Orcas). A workaround is to pass the culture without the user overrides as the format…

0

DateTime.Parse() fails when separator is " " (space) in .Net v2.0 RTM

In Whidbey (Microsoft.Net v2.0), DateTime.Parse() throws an exception if the date separator is a space.  This was fixed in future QFEs, including the Whidbey Vista release, so you’ll only see this on XP, 2003, etc and not on Vista. This is fixed in future versions, so if you apply most any QFE to .Net 2.0…

0

How do I get localization in JScript (JavaScript) in IE7?

I ran into an interesting problem with a Vista sidebar calendar gadget.  It seems that it is not exactly trivial to find out interesting NLS data like localized month names, first day of week, etc. from JScript. Eventually I found a workaround for some of the data.  VBScript has MonthName, WeekDayName and WeekDay functions that can be…

4

ISO 8601 Week of Year format in Microsoft .Net

Several people have noticed that Calendar.GetWeekOfYear() is almost like the ISO 8601 week when passed CalendarWeekRule.FirstFourDayWeek and DayOfWeek.Monday, however it is a little bit different.  Specifically ISO 8601 always has 7 day weeks.  If the first partial week of a year doesn’t contain Thursday, then it is counted as the last week of the previous year.  Likewise, if…

19

Custom Time Zones in Windows

Someone asked about adding the “Olson” database of timezones to Windows, and I learned about tzedit.exe and the registry keys.  Tzedit.exe is a simple tool that allows you to add or edit the time zone registry entries, which live in the registry at HKLMSoftwareMicrosoftWindows NTCurrentVersionTime Zones… Windows KB 317211 discusses various ways of changing time zone…

7