home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19401 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.9 KB  |  51 lines

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