Localized Date Strings

I just saw this interesting exchange on an internal discussion list, and thought I'd pass it on:

From: A Microsoft Guy
Subject: Formatting date/time strings

Is there a good way to format a date/time string using the current system local?  The javascript function toLocaleString() only outputs the long date + time format.  I’m looking for a way to do short date, short time, and other formats.  Any tips/suggestions, other than just providing a format string that gets localized for a particular language (not the best solution, but better than nothing).

From: A Sidebar Guy
Subject: RE: Formatting date/time strings

Shawn Steele graciously provided us with some information on this and added it to his blog here:

https://blogs.msdn.com/shawnste/archive/2006/09/05/741871.aspx

Comments