Play Games

Search This Blog

Thursday, November 26, 2020

is current year a leap year? apex salesforce - Salesforce Globe For You

 is current year a leap year? apex salesforce  - Salesforce Globe For You 

Solution: use isLeapYear() of Date to know if the given year is leap year or not.

Example: To check current year is leap year or not.

Run the piece of code below in anonymous window.

String year = system.today().year();

system.debug('Is current Year leap year:'+Date.isLeapYear(year));

output:



No comments:

Post a Comment