Here is the List I found, not exhaustive though.
- https://html-shark.com/HTML/LanguageCodes.htm (Covers a lot)
- http://www.lingoes.net/en/translator/langcode.htm (backup)
EDITED: a more comprehensive list https://gist.github.com/mlconnor/1887156
Answer from Adeyemi Simeon on Stack OverflowI'd recommend any JavaScript date library in conjunction with UserContext.dateFormat. As you say, browser locale implementations are pretty brittle. The display on the client should be completely independent of the underlying value and whether or not it was remoted :-)
Edit: or carefully take advantage of the DateUtil object already present (courtesy @TehNrd)
From the comments:
DateUtil.getDateTimeStringFromUserLocale(d); and DateUtil.getDateStringFromUserLocale(d); I'd recommend wrapping them in a try catch as they could change at anytime.
Use DateFormat.js to convert date into any user locale format. To get the user locale in apex
UserInfo.getLocale()