You need to sign in to do that
Don't have an account?
daniel.cecil.dev
Date Format Language
Hello,
I'm trying to format a date's month in the user's language but keep getting it in English.
Here's the code I have:
Datetime d = System.now(); Datetime thisDate = DateTime.newInstance(d.year(), d.month(), d.day()); String format = thisDate.format('MMMM'); System.debug(format);
Any ideas?
Many thanks, Dan
Take the month as a number and create a custom apex class, wich reads that number and set the corresponding month name in the language you want by using custom labels (if your org is multilanguage you can set several languages values to the same label).
Oh I thought that might be the case.. was looking for an easier solution. It should be implemented in Salesforce as I would have thought it's a pretty popular requirement?
Thanks for your help!
Dan