function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Doug ACFDoug ACF 

DaysInMonth / IsLeapYear Not Working

I'm writing a bunch of date logic and haven't been able to get the daysInMonth and isLeapYear methods to work.  When I go to save in Eclipse, I get "Method does not exist or incorrect signature". 
 
My basic code looks like:
 

Date startDate=oli.Project_Start_Date__c;

Integer startYear=startDate.year();

if (isLeapYear(startYear))

dostuff...;

Any ideas?

zchenzchen
That's static method,
try
 
if(Date.isLeapYear( startYear) )
do ....