• 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: "koenig.yvan" <email@hidden>
  • Date: Fri, 14 Feb 2014 14:35:03 +0100


Le 14/02/2014 à 14:10, JF <email@hidden> a écrit :

Hello
I am using this to put a date into the subject of an email created by an applescript.
do shell script "date +'%B %Y'" which gives me "February 2014" for this month's emails

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"".
Also any variations I have tried do not work either. I have searched for this on the Internet but have found none, except masses of Unix code lines which I am sure are not required for this simple shell script.

Can someone help me with this?

TIA
James


set fake to current date
set day of fake to 1
set fake to fake - (1 * days)
set myString to (month of fake as text) & space & year of fake

I'm quite sure that it's faster than the code triggering do shell script

Yvan KOENIG (VALLAURIS, France) vendredi 14 février 2014 14:34:20



 _______________________________________________
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: do shell script date with last month's date
  • Next by Date: Re(2): do shell script date with last month's date
  • Previous by thread: posting terminal output to the list (was Re: 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