• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Date question with weeknumber
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date question with weeknumber


  • Subject: Re: Date question with weeknumber
  • From: "Nigel Garvey" <email@hidden>
  • Date: Tue, 4 May 2010 08:51:28 +0100

Mark J. Reed wrote on Mon, 3 May 2010 19:04:17 -0400:

>On Mon, May 3, 2010 at 5:53 PM, Nigel Garvey

>   -- In Snow Leopard, calculations using dates before
>>    -- 1583 have been goodness-me'd by a shift to Julian dates before some
>>    -- time in 1582.
>>     set baseMonday to date "Monday 3 January 1583 00:00:00"
>>
>
>The first day of the Gregorian calendar, at least in those countries that
>adopted it immediately, was Friday, the 15th of October, 1582 (the previous
>day being Thursday the 4th according to the Julian calendar).  So the first
>Gregorian Monday would be October 18th of that year.  Of course, you could
>pick any Monday in the Julian calendar as well, but based on your comment
>above I infer that would not work on pre-SL systems.

Any Monday works pre-SL as well and the compiled script is transportable
between systems, but it was less inconvenient to use a 1583 date in my
original post than to explain that it had to be such-and-such a date on
one system and something else on all the others. With the base year I
used to use — 1000 — the "4th January" date has to be initialised like
this in SL:

    set now to (current date)
    -- Get a known 4th January.
    set Jan4 to date "Saturday 30 December 0999 00:00:00"
    -- Convert it to 4th January this year.
    set Jan4's year to now's year

>I remain surprised the date of Julian/Gregorian conversion isn't
>locale-sensitive in Applescript, though.

I think it's pretty clueless implementing it anyway, given the potential
for wrecking date calculations, the unlikelihood of anyone wanting to
know Julian dates, and the fact that — as you say — the "date at the
time" is only going to be correct for a handful of locations anyway. It
would have been far better to have implemented a separate 'Julian date'
class with the necessary coercions and/or to have introduced a 'locale
date' class.

I suppose AppleScript dates might be deprecated altogether eventually in
favour of something slower.

NG
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Date question with weeknumber
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: Date question with weeknumber (From: "Nigel Garvey" <email@hidden>)
 >Re: Date question with weeknumber (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: RE: String to real conversion question
  • Next by Date: Re: Date question with weeknumber
  • Previous by thread: Re: Date question with weeknumber
  • Next by thread: Re: Date question with weeknumber
  • Index(es):
    • Date
    • Thread