• 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
Weird date "string" glitch!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird date "string" glitch!


  • Subject: Weird date "string" glitch!
  • From: Loren Ryter <email@hidden>
  • Date: Fri, 02 Dec 2005 15:17:12 -0500
  • Thread-topic: Weird date "string" glitch!


Can anyone tell me why applescript seems to convert some strings to dates
for no apparent reason?

I want to try to convert a string to a date and if it fails do something
else, as in:

Try
Set d to date "string"
On error
Set d to "cannot make a date out of the string"
End try

But I'm finding that some strings just turn into a random date:

-- "Steve's with the apostrophe"
--set d to date "Security Now! Episode 16: Your Questions, Steve's Answers"

set d to date "Thursday, September 1, 2005 4:00:00 PM"

--- "Steves" without the apostrophe
--set d to date "Security Now! Episode 16: Your Questions, Steves Answers"

set d to date "Friday, December 2, 2005 4:00:00 PM"


-- this gets the expected result when attempting to compile:
-- (Invalid date and time Security Now.)

--set d to date "Security Now"

Can anyone tell me what's going on with that?




 _______________________________________________
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: Weird date "string" glitch!
      • From: Dave Balderstone <email@hidden>
  • Prev by Date: Re: [OT] My life after AS: shell commands, perl?
  • Next by Date: Re: Weird date "string" glitch!
  • Previous by thread: Re: Excel 2004 - How to set fill color of cells?
  • Next by thread: Re: Weird date "string" glitch!
  • Index(es):
    • Date
    • Thread