How to get current year using apex in Salesforce?

Sample Code:

Date dat = System.today();
Integer yr = dat.year();
System.debug('Year is ' + yr);

Cheers!!!

No comments:

Post a Comment