开发者

NLS API gives wrong long date for "en-ca"

The long date for culture "en-ca" is MMMM-dd-yy . This is correct and I have verified this with documentation. You can verify the result in .NET by doing the following.

   Dim culture As CultureInfo = CultureInfo.GetCultureInfo("en-ca")
   MsgBox(culture.DateTimeForm开发者_开发问答at.LongDatePattern)

I am trying to figure out why there is a difference with the NLS API which will return "MMMMM d, yyyy"as the default long date. This is incorrect. Am I missing something here? I'm just curious if anyone knows the specifics around this.

NLS API Reference: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx


This has changed between .NET 3.5SP1 and .NET 4.0. .NET 3.5 produces MMMM d,yyyy, same as the documented Vista NLS value.

.NET 4.0 produces MMMM-dd-yy. Same as what I get when I use GetLocaleInfo() on Win7 with:

wchar_t buf[256];
GetLocaleInfo(0x1009, LOCALE_SLONGDATE, buf, 256);

I think .NET 4.0 is now using the Windows locale info instead of relying on its own tables. Nevertheless, nothing changes as fast as culture data. If you think this is incorrect then you can submit feedback at connect.microsoft.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜