6.2K
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);
SFDC Learn & Share!!
Happy to Coding!