home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!spillman!tye
- From: tye@spillman.uucp (E. Tye McQueen)
- Subject: Re: Recurring date/times?
- Message-ID: <1993Jan08.044526.36650@spillman.uucp>
- Date: Fri, 08 Jan 1993 04:45:26 GMT
- References: <C0D387.HEH@panix.com> <1993Jan5.175737.23724@miki.pictel.com>
- Organization: Spillman Data Systems
- Lines: 40
-
- geiser@pictel.com (Wayne Geiser) writes:
-
- )In article <C0D387.HEH@panix.com>, rmah@panix.com (Robert Mah) writes:
- )|> Anyone have any suggestions on good data structures for representing
- )|> recurring dates and times. That is, things like "the first teusday
- )|> of every month" or "three days before the end of every month", etc.
- )
- )m Monthly event (Gregorian number)
- )m/d Gregorian event with no associated year
- )m/d/y Gregorian event
- )Hm/d Jewish event (i.e., Hebrew calendar)
- )HFm/d Jewish fast day (special rules apply)
- )Im/d Islamic event
- )Jm/d Julian event
- )* Every day
- )M(m/d) Monday on or before date (T, W, R, F, S, U are the other days of the
- ) week)
- )E Easter
- )m/d+days Add number of days to the date
- )m/d-days Subtract number of days from date
- )
- )There are lots of permutations:
- )
- )E+60 Gives you Corpus Christi (Thursday following Trinity Sunday)
- )H1/1-16 Gives Purim (needs odd calculation because of leap months in the
- ) Hebrew calendar
- )W(*) Every Wednesday
- )M(1/31) Australia Day Observed (Monday on or after 1/26).
- )*+1 Tomorrow
-
- Are you missing one for "the day you get off for Christmas"?
- Ie. 12/25 unless on a weekend when you add or subtract one.
-
- Very similar is "the day you get off for Independence day":
- 07/04 unless on a weekend when you go to the next Monday.
-
- tye@spillman.com Tye McQueen, E.
- ----------------------------------------------------------
- Nothing is obvious unless you are overlooking something.
- ----------------------------------------------------------
-