• 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: AppleScript date in ISO-8601 ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript date in ISO-8601 ?


  • Subject: Re: AppleScript date in ISO-8601 ?
  • From: Christopher Stone <email@hidden>
  • Date: Thu, 30 Apr 2015 21:22:05 -0500

On Apr 30, 2015, at 02:32, emile.a.schwarz <email@hidden> wrote:
merci Yvan, exactly what I wanted: do shell script "date +%F"
…
and also I wanted to know how people do that nowadays.
______________________________________________________________________

Hey Emile,

# Shell
set dt1 to do shell script "date +%F"
--> "2015-04-30"

I usually use the Satimage.osax.  It's fast and simple.

# Satimage.osax
set dt2 to strftime (current date) into "%F"
--> "2015-04-30"

If I want a non-osax method I usually use something like what Barry posted:

set AppleScript's text item delimiters to "T"
set dt3 to text item 1 of ((current date) as «class isot» as string)
--> "2015-04-30"

--
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

References: 
 >AppleScript date in ISO-8601 ? (From: "emile.a.schwarz" <email@hidden>)
 >Re: AppleScript date in ISO-8601 ? (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: GoTo Specific Note in Notes.app?
  • Next by Date: Re: Scripting Mail: Body content as plain text with quotes
  • Previous by thread: Re: AppleScript date in ISO-8601 ?
  • Next by thread: Re: AppleScript date in ISO-8601 ?
  • Index(es):
    • Date
    • Thread