• 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: do shell script date with last month's date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script date with last month's date


  • Subject: Re: do shell script date with last month's date
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 14 Feb 2014 07:33:09 -0600

On Feb 14, 2014, at 07:10, JF <email@hidden> wrote:
> However, some of my emails require last month's date, so for emails sent in February the output should be "January 2014"
> ...
> I have tried:
> do shell script "date +'%B -1 month %Y'"
> but the output is "February -1 month 2014"".
______________________________________________________________________

Hey James,

Always check the examples in the man page.  :)

Sometimes they're very opaque, but sometimes they're really helpful.

	date -v1m "+%B %Y"

The offset is a switch and doesn't go in the format string.

--
Best Regards,
Chris


 _______________________________________________
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(2): do shell script date with last month's date
      • From: JF <email@hidden>
References: 
 >do shell script date with last month's date (From: JF <email@hidden>)

  • Prev by Date: Re: Flattening Scripts
  • Next by Date: Re: do shell script date with last month's date
  • Previous by thread: do shell script date with last month's date
  • Next by thread: Re(2): do shell script date with last month's date
  • Index(es):
    • Date
    • Thread