You need to sign in to do that
Don't have an account?
Faizan Ali 24
Date string format
Hi All,
I want to change the format of my date. Currently, the format is in yyyy-MM-dd but I want it to be like 12th December 2020.
My apex code is currently:
currentDateString = string.valueOf(Date.today());
And in my visualforce page it is:
<apex:outputLabel id="currentDateString" style="color:white;font-size:26px;font-weight:bold">{!currentDateString}</apex:outputLabel>
I want to change the format of my date. Currently, the format is in yyyy-MM-dd but I want it to be like 12th December 2020.
My apex code is currently:
currentDateString = string.valueOf(Date.today());
And in my visualforce page it is:
<apex:outputLabel id="currentDateString" style="color:white;font-size:26px;font-weight:bold">{!currentDateString}</apex:outputLabel>
Try this following Way
Let me know, if it's helps you and mark the best of this answer so that it can help to others.
Thank You
All Answers
Looks like there is no standard function in salesforce that does this conversion to ddth mmm,yyyy format. The below article is not in context of salesforce but would serve as a pseudo code to implement the logic
https://stackoverflow.com/questions/37272514/change-date-format-to-ddth-mmm-yyyy
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Try this following Way
Let me know, if it's helps you and mark the best of this answer so that it can help to others.
Thank You