Chris Burke wrote: > I'm happy to include these calculations in dates, and overlooked them > before. > > However, the ISO 8601 calendar treats the first day of the week as a > Monday, and I suggest that both wks and weeknumber do likewise. This > would mean that the left argument defaults to 1. Also, I don't see any > point in having a different left argument, so I would just make both > return the ISO 8601 calendar values only. Are there any other ISO > calculations that return different values?
Just to put a plug in for the astronomical community, who obviously are stakeholders when it comes to things related to time: Please be sure to consult "Astronomical Algorithms" by Jean Meeus (Willmann-Bell, 1998, 2nd ed.; 1991, 1st ed.). Chapter 7 (at least in the 1st ed.) deals with the fundamental day counter in astronomy, namely, the Julian Day number--and this (and its reverse) is a calculation that J should really have built into its dates.ijs script. (There's also a Modified Julian Day number, which uses a more recent date as its zero point--just as J uses 1/1/1800.) By the way, the Julian Day number is counted from 4713 B.C. (synchronized starting point of several astronomical cycles) and is a completely different thing than the similar-sounding Julian Date, which is the day number within a year starting with January 1. If you're doing any kind of synchronicity of time series data (e.g., agricultural, financial, etc.) with astronomical phenomena, the Julian Day number (and Modified Julian Day) conversions are essential calculations. Two other books dealing with time and calendars that might be helpful are the following: "Explanatory Supplement to the Astronomical Almanac" (University Science Books, 1992) is one of the foundational books for astronomical computing and celestial phenomena--this is an area where J ought to shine (pardon the pun)! Chapter 12 deals specifically with calendars and gives some alternative algorithms to the above book for the Julian Day number conversions. "Calendrical Calculations" by Reingold and Dershowitz (Cambridge Univ Press, 3rd ed., 2007; 2nd ed., 2001; 1st ed., 1997) is probably the premier book available dealing with calendars of all kinds (even a very short chapter on the ISO calendar), giving formulas for their construction and calculation. I hope these resources might lead you to include at least some other basic date-related verbs. Thanks for considering them! Harvey ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
