[Coco] Julian Date

Gene Heskett gheskett at shentel.net
Sat May 20 19:10:07 EDT 2017


On Saturday 20 May 2017 17:42:03 Wayne Campbell wrote:

> I read your code. Not bad, but could be better. I will revamp it and
> post my alteration.
>
> On May 20, 2017 11:57 AM, "phillip taylor" <ptaylor2446 at gmail.com> 
wrote:
> > I hope that you all enjoy the julian date that I posted here.
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco

This code is incomplete, and will be wrong once every 400 years.
The code in the original K&R C book shows how it should be done.

Basically if the year is divisible by 4 its a leap year UNLESS the date 
is divisible by 400 without a remainder, then it is not a leap year.  
2000 was not a leap year. 2400 will not be a leap year.  The C manual 
uses the mod(year,4) or mod(year,400) to determine this IIRC.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


More information about the Coco mailing list