• 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
Subtract 1 month from date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Subtract 1 month from date


  • Subject: Subtract 1 month from date
  • From: Eric Geoffroy <email@hidden>
  • Date: Wed, 08 Dec 2004 15:37:21 -0800

Or 4 weeks I suppose. It's okay if it's not super precise.

I can say "d + 4 * weeks"
but it won't allow "d + 1 * months
and won't allow d - 1 * weeks

Output should look like this.

11/1/2004...12/1/2004

The idea is to coerce dates into range of past month for reporting porpoises. (purposes. I can't resist a good malapropism)

I guess I could coerce to numbers and do simple math like this: (pseudo code coming)
today's date as words
set mth to (word 1 as number) -1
set d to "1/" & mth & year



set
d to (get current date)
set e to d - 4 * weeks
set {dMth, dDay} to words of (short date string of d) -- DD/MM/YY
set eMth to first word of (short date string of e)
set strDate to (dMth & "/1/" & year of d) as text
set endDate to (eMth & "1/" & year of e)
set searchrange to strDate & "..." & endDate

 _______________________________________________
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: Subtract 1 month from date
      • From: Mr Tea <email@hidden>
    • Re: Subtract 1 month from date
      • From: Mr Tea <email@hidden>
    • Re: Subtract 1 month from date
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Unwinding the containment hierarchy of a reference
  • Next by Date: Re: Subtract 1 month from date
  • Previous by thread: Re: Re: Filemaker
  • Next by thread: Re: Subtract 1 month from date
  • Index(es):
    • Date
    • Thread