function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion 

Date Format Language



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 =;
Datetime thisDate = DateTime.newInstance(d.year(), d.month(),;
String format = thisDate.format('MMMM');

 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!


Phil WPhil W
It's 2018 and this is (I believe) still the case! Madness!