Representable date range: experiment results
Representable date range: experiment results
- Subject: Representable date range: experiment results
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 20 Oct 2005 11:53:07 -0400
Mr. Neuburg's book states that the range of reprecentable years seems
to be 100-9999, but I had no problems on Panther or Tiger with years
before 100, all the way down to 1 AD/CE:
$ osascript -e 'tell current date to set {year, d} to {1, it}
date string of d'Saturday, October 20, 0001October
20, 1, in the Gregorian calendar is October 22, 1, in the Julian
calendar (if you don't know why and want a long boring explanation,
send me a private email . . . :)), and as you can see by the output of
the UNIX cal(1) program (which uses the Julian calendar prior to
September 1752, at least in my locale):
$ cal 10 1 October 1
Su Mo Tu We Th Fr Sa 1
2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 2223 24 25 26 27 28 29
30 31
October 22, 1, was in fact a Saturday.
Interestingly, if you try to set year 0, you get the right weekday for 0 CE (1 BCE), but the year number still displays as 1:
$ osascript -e 'tell current date to set {year, d} to {0, it}
date string of d'
Friday, October 20, 0001
Trying to set negative years yields an error.
On the high side, 9999 does seem to be the limit. If you set it
to 10000 or more, you get the number modulo 10000 in the output, which
means you can actually get year 0 that way:
$ osascript -e 'tell current date to set {year, d} to {10000, it}
date string of d'
Friday, October 20, 0000
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden