• 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: Andrew Oliver <email@hidden>
  • Date: Mon, 20 Dec 2004 11:54:48 -0800

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

  • Follow-Ups:
    • Re: Coerce date saved as text back to Applescript's date format?
      • From: Jake Pietrykowski <email@hidden>
References: 
 >Coerce date saved as text back to Applescript's date format? (From: Jake Pietrykowski <email@hidden>)

  • Prev by Date: 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: 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