• 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 computation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date computation


  • Subject: Re: Date computation
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 7 Jan 2005 09:44:14 -0700

On Jan 7, 2005, at 3:56 AM, Nigel Garvey wrote:

set today to (current date)
  copy today to b
  set b's day to 14
  set secondWednesday to b - (b - (date "Wednesday, 1 January 1000
00:00:00")) mod weeks
  if secondWednesday is less than or equal to today then
    tell b to set {day, day} to {32, 14}
    set secondWednesday to b - (b - (date "Wednesday, 1 January 1000
00:00:00")) mod weeks
  end if
  return secondWednesday

Slick, but I can't understand it; care to explain the maths, please?

In reviewing the script, I realized that I failed to specify that if today is the second Wednesday, it should return the second Wednesday of next month. So what change needs to be made in the script.

--
"My country, right or wrong: if right, to be kept right; and if wrong, to be set right."
Senator Carl Schurz of Missouri, 1899


_______________________________________________
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


  • Follow-Ups:
    • Re: Date computation
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Date computation (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Date computation
  • Next by Date: Re: Date computation
  • Previous by thread: Re: Date computation
  • Next by thread: Re: Date computation
  • Index(es):
    • Date
    • Thread