• 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: Yvan KOENIG <email@hidden>
  • Date: Wed, 29 Apr 2015 09:39:05 +0200


Le 29/04/2015 à 08:51, emile.a.schwarz <email@hidden> a écrit :

Hi all,

 

I searched in the Language Guide, etc. but I failed to find a built in way to get dates in ISO-8601 format (SQLDate).

 

Ideas ?

 

Emile



Salut Émile



on dateToISO(aDate)
tell aDate to tell ((its year) * 10000 + (its month) * 100 + (its day)) as text to return text 1 thru 4 & "-" & text 5 thru 6 & "-" & text 7 thru 8
end dateToISO

#=====

on makeStamp(aDate)
tell aDate to return (((its year) * 10000 + (its month) * 100 + (its day)) as text) & "_" & text 2 thru -1 of ((1000000 + (its hours) * 10000 + (its minutes) * 100 + (its seconds)) as text)
end makeStamp

#=====

do shell script "date +%Y-%m-%d_%H:%M:%S"

do shell script "date +%F_%T"


Yvan KOENIG (VALLAURIS, France) mercredi 29 avril 2015 09:38:13

 _______________________________________________
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: AppleScript date in ISO-8601 ?
      • From: Christopher Stone <email@hidden>
References: 
 >AppleScript date in ISO-8601 ? (From: "emile.a.schwarz" <email@hidden>)

  • Prev by Date: AppleScript date in ISO-8601 ?
  • Next by Date: Re: AppleScript date in ISO-8601 ?
  • Previous by thread: AppleScript date in ISO-8601 ?
  • Next by thread: Re: AppleScript date in ISO-8601 ?
  • Index(es):
    • Date
    • Thread