Re: Conversion of ISO Date String to AppleScript Date
Re: Conversion of ISO Date String to AppleScript Date
- Subject: Re: Conversion of ISO Date String to AppleScript Date
- From: Shane Stanley <email@hidden>
- Date: Sun, 05 Mar 2017 11:50:45 +1100
On 5 Mar 2017, at 8:05 am, Christopher Stone <email@hidden> wrote:
# Create an AppleScript Date-Object from an ISO Date String. set isoDateStr to "2013-04-29T21:22" set myAsDateFromIsoStr to (do shell script "echo " & isoDateStr as «class isot») as date
--> date "Monday, April 29, 2013 at 21:22:00"
Just be aware that this doesn't return the correct time if the T is replaced by a space, as in Jim's example:
set isoDateStr to "2013-04-29 21:22" set myAsDateFromIsoStr to (do shell script "echo " & isoDateStr as «class isot») as date --> date "Monday, 29 April 2013 at 12:00:00 am"
|
_______________________________________________
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