Wednesday, September 4, 2019

How to get month name using apex in salesforce

Sample Code
DateTime dt = Datetime.now();
System.debug('Month ===> '+dt.format('MM'));
System.debug('Month Name Short ===> '+dt.format('MMM'));
System.debug('Full Month Name ===> '+dt.format('MMMM'));


Output

1 comment: