• 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: Coerce date saved as text back to Applescript's date format?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coerce date saved as text back to Applescript's date format?


  • Subject: Re: Coerce date saved as text back to Applescript's date format?
  • From: Jake Pietrykowski <email@hidden>
  • Date: Mon, 20 Dec 2004 14:04:37 -0600

Well...I 'thought' I was doing it right! ;-)

Thanks...turns out not only was I using an 'incorrect' date...

I was attempting to set theDate to date (theString) inside of a 'tell window
theWindow' in my AppleScript Studio app. Move it outside and all is well.

Thanks,
Jake


On 12/20/04 1:54 PM, "Andrew Oliver" <email@hidden> wrote:

> On 12/20/04 11:47 AM, "Jake Pietrykowski" <email@hidden> wrote:
>
>> How can I coerce the following text data:
>>
>> "Friday, December 16, 2004 11:24:05 AM"
>>
>> back into Applescript's date format?
>
> Trick question!
>
> You can't because there is no such date as "Friday December 16, 2004"
>
> In 2004, December 16th was a Thursday.
>
> That said, assuming you have a valid date string you can coerce it to a date
> object by simply:
>
> set theString to "Thursday December 16, 2004 11:24:05 AM"
> set theDate to (date theString)
>
> But the string has to be something AppleScript can reasonably coerce to a
> date.
>
> Andrew
> :)
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Coerce date saved as text back to Applescript's date format? (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: Coerce date saved as text back to Applescript's date format?
  • Next by Date: Re: Coerce date saved as text back to Applescript's date format?
  • Previous by thread: Re: Coerce date saved as text back to Applescript's date format?
  • Next by thread: Re: Coerce date saved as text back to Applescript's date format?
  • Index(es):
    • Date
    • Thread