Re: [foxboro] Day of Week

Babwani's congruence (published in The Mathematical Gazette, November 2004) is 
simpler to program than Zeller's congruence, and more versatile - allowing you 
to use any 3 of month, day, year, day of week to calculate the 4th.  It numbers 
the months from 1 (Jan) to 12 (Dec), instead of 3 to 14, effectively treating 
the year as starting on 1 January instead of Zeller's 1 March.  

http://www.geocities.com/sohaelbabwani/algorithm.html

-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] On 
Behalf Of Jeremy Milum
Sent: Tuesday, June 09, 2009 9:58 AM
To: foxboro@xxxxxxxxxxxxx
Subject: Re: [foxboro] Day of Week

On Mon, Jun 8, 2009 at 7:25 PM, Fitzgerrell,
Kevin<Kevin_Fitzgerrell@xxxxxxx> wrote:
> 3) Harder but very robust - Use the DAY, MONTH and YEAR
> parameters of the station block and calculate the day of the week
> algorithmically - google for Babwani's Congruence - probably the most 
> programmer friendly method.

I think that's really Zeller's Congruence
(http://en.wikipedia.org/wiki/Zeller's_congruence)

I posted the calc block code for that a while back, but it contained
an error for jan & feb that was corrected by Maks Wilde in an email he
sent me. I need to put the corrected code up on the wiki since this is
the second time this has come up. I'll do that tomorrow as this is the
ideal app for a calc block rather than the other options.

Jeremy

-- 
Patron saints in general are broadband connections to the Almighty
- Michelle Delio, Wired News
 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 
 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: