• 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: date syntax not working on 10.10.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date syntax not working on 10.10.5?


  • Subject: Re: date syntax not working on 10.10.5?
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 14 Aug 2015 18:18:34 -0500

On Aug 14, 2015, at 15:21, Bruce Robertson <email@hidden> wrote:
What is the expected result of this example?  My result is:
date "Friday, August 14, 2015 at 12:00:00 AM"
______________________________________________________________________

Hey Bruce,

On what OSX?

That appears to be string-to-date conversion wonkiness and can be related to several factors.

What happens when you use this more straightforward handler?

dateFromTimeStr("10:15")

--> date "Friday, August 14, 2015 at 10:15:00 CDT"

on dateFromTimeStr(timeStr)
  set _date to current date
  set time of _date to 0
  set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
  tell timeStr to set _date to _date + ((text item 1) * hours) + ((text item 2) * minutes)
  set AppleScript's text item delimiters to oldTIDS
  return _date
end dateFromTimeStr

--
Best Regards,
Chris
______________________________________________________________
MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.10.5

 _______________________________________________
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: 
 >date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Christopher Stone <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Michael Grant <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Christopher Stone <email@hidden>)
 >Re: date syntax not working on 10.10.5? (From: Bruce Robertson <email@hidden>)

  • Prev by Date: Re: Saving PDF as RTF in Adobe Acrobat
  • Next by Date: Re: date syntax not working on 10.10.5?
  • Previous by thread: Re: date syntax not working on 10.10.5?
  • Next by thread: Re: date syntax not working on 10.10.5?
  • Index(es):
    • Date
    • Thread