New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Sunday, 14 October 2012

Retrieving month value from date field in apex class/Trigger

In two ways we can capture month value from date field:

date_fieldname__c.month() 
Which returns 1,2,3.... integer values
string.valueof(date_fieldname__c).substring(5,7)
Which return '01','02','03'.... string values

No comments:

Post a Comment

Labels