Any assistance would be much appreciated!

Looking to build a formula field that extracts Month and Year of a custom date field. (if it is 28.09.2020 as the date then the formula field would display September 2020)


You can try the below formula. based on your date field you have to use "If" to do null check.

Best resources for building formulas https://help.salesforce.com/articleView?id=customize_functions.htm&type=5

1, "January",
2, "February",
3, "March", 
4, "April", 
5, "May", 
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"None")  & " " &  TEXT(Year(DATEVALUE(CreatedDate)))

As mentioned in this question you can try below code as it shows in the required format:

<apex:outputText value="{0, date, MMMM d','  yyyy}">
<apex:param value="{!NOW()}" />

Have a look at the JavaDocs for SimpleDateFormat for the various date formats.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.