1

Im trying to get a list of all the date formats salesforce expects for all the supported locales in my org. I already have the list of locales codes displayed on a visualforce page. I just need the date formats. Is there a way to get this? The formats I have are incorrect.

Update: Im asking where can I get the dateformats I want to add a new locale to my map or is there a way I can write apex to just spit out all the date formats for me so I can update this map with the correct format versus referring to this https://help.salesforce.com/articleView?id=admin_supported_locales.htm&type=0.

I want to do something like this solution https://salesforce.stackexchange.com/a/23908/50846 but with the date formats also.

Example below:

en_US(locale) = mm/dd/yyyy(date format)

1 Answers1

1

Someone had Already answered your question :- Get dateformat based on Locale . You might need to keep an eye on salesforce new releases if they add new timeZones or change date format.

Manjot Singh
  • 3,508
  • 19
  • 42
  • Yes I've have seen this. I guess I wasn't clear. SInce there have been more timezones since that was created where can I find the latest date formats so I can add to my list? –  Nov 07 '17 at 17:43
  • https://help.salesforce.com/articleView?id=admin_supported_locales.htm&type=0 did you had a look at this document? – Manjot Singh Nov 07 '17 at 17:48
  • yes that's what I've been using. –  Nov 07 '17 at 17:50
  • I also wants to know what is your use case. I think for most of cases list of locales should be enough – Manjot Singh Nov 07 '17 at 18:00
  • use case is if a user enters a date manually or by selecting from a datepicker in the correct format. The issue is for some locales its giving some users invalid date error. –  Nov 07 '17 at 18:23