Home SALESFORCEAPEX How To get Day, Month and Year values using Apex Class in Salesforce

How To get Day, Month and Year values using Apex Class in Salesforce

Use the Following code to get the Day, Month and Year values using Apex Class

Integer d = Date.Today().Day();
Integer m = Date.Today().Month();
Integer y = Date.Today().Year();
system.debug(‘Day::’+d);
system.debug(‘Month::’+m);
system.debug(‘Year::’+y);

Output:

SFDC Learn & Share!!
Happy to Coding!

You may also like

Leave a Comment