IanWaterman
Programmer
I need to identify Leap years,
I am sure there a simple formula that can analyse a date and know whether it is a leap year or not, just can not think what it is.
I could just take year from the formula, subtract last known leap year and do modulus 4 or remainder 4 if zero then leap year. However, I think Turn of centuries do not obey this rule. Of course I will be long dead before this happens so I will not be sued, I just wanted to do it properly and efficiently.
Ian
I am sure there a simple formula that can analyse a date and know whether it is a leap year or not, just can not think what it is.
I could just take year from the formula, subtract last known leap year and do modulus 4 or remainder 4 if zero then leap year. However, I think Turn of centuries do not obey this rule. Of course I will be long dead before this happens so I will not be sued, I just wanted to do it properly and efficiently.
Ian