Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.sinclair > #157

Re: Sinclair mentioned on the Today programme on Radio 4 this morning

From lachman@ebony.ppc.ubc.ca (Milton Lachman)
Newsgroups comp.sys.sinclair
Subject Re: Sinclair mentioned on the Today programme on Radio 4 this morning
Date 2011-04-12 18:45 +0000
Organization Pulp and Paper Centre
Message-ID <io26kf$19o$1@speranza.aioe.org> (permalink)
References <hqkv4r$1sl$1@speranza.aioe.org>

Show all headers | View raw


  [Here's the revision of the table-based Date-stamp
   conversion routine w/out April Fools' Easter Eggs.]

Given:

D$(8) as a Date-stamp CCYYMMDD in basic ISO format
F%    as a Flag (1 for Gregorian, 0 for Julian or quasi-Old-Style)
T$    as a table of offsets

the superBASIC routine below is to compute:

w%    as the ISO-compatible number of the corresponding weekday:
         Sun=0  Mon=1  Tue=2  Wed=3  Thu=4  Fri=5  Sat=6

REMark Step 0 - define the table of offsets:
LET T$="400351362402513345660122345567112344560012"

REMark Step 1 - Process the Date-stamp:
LET e$=D$- 300 : v%=e$(1TO 4)DIV 4 : g%=T$(e$(1TO 2))*F%

REMark Step 2 - compute the weekday-number:
LET w%=(v%+ D$(1TO 4)+ T$(D$(5TO 6))+ D$(7TO 8)- g%)MOD 7

This routine is valid for 3 different calendars as follows:

       Gregorian: from 15.oct.1582 to 28.feb.4300
          Julian:  from 1.mar.1000 to 31.dec.4246
       quasi-Old-Style: circa 1100 to 02.sep.1752

 For Old-Style dates: January & February are to be treated as months
 13 & 14 occurring at the end of the civil year, and 1.-24.mar as in
 month 1 of the following year.

--
        REFERENCES

http://oz.ccnet.us/dayofweek/
http://www.guernsey.net/~sgibbs/roman.html
http://de.wikipedia.org/wiki/Wochentagsberechnung#Jahrhundertziffer

Back to comp.sys.sinclair | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Sinclair mentioned on the Today programme on Radio 4 this morning lachman@ebony.ppc.ubc.ca (Milton Lachman) - 2011-04-12 18:45 +0000
  Re: Sinclair mentioned on the Today programme on Radio 4 this morning "Brian Gaff" <Briang1@blueyonder.co.uk> - 2011-04-13 08:12 +0100
    Re: Sinclair mentioned on the Today programme on Radio 4 this morning lachman@ebony.ppc.ubc.ca (Milton Lachman) - 2011-04-14 19:55 +0000

csiph-web