• 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 coersion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Date coersion


  • Subject: RE: Date coersion
  • From: email@hidden
  • Date: Thu, 11 Jul 2002 00:10:31 EDT

Paul,

Date is a kind of odd fish in the sense that it is a descreet data
structure of it's own, not of any other type. The first step that I would
recommend is creating a new date variable that you can then go back and
change, i.e. :

set Now to the current date

Having done that, you can poke at the various values contained within Now:

set the year of Now to 1971
set the month of Now to September
set the day of Now to 17

hope the points you in the right direction for what you're trying to do. I
can send you a more detailed example from a script I have (offlist) if you
desire it.

Best Wishes
=-= Marc Glasgow

Paul wrote:
>I want to take a date string from a text field and convert
>it into a date.
>
>The first line accepts the string into nDate set the nDate
>to contents of text field "toDate" as string
>
>The help says to coerse the string to a date as follows set
>cDate to date nDate
>
>But when run I get Apple script error
>NSReceiverEvaluationScriptError: 3 (1)
>
>What's wrong?
>
>I am new to Applescript but hey you have to start sometime!
>
>Thanks Paul Garfield
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: RE: Preparing a lecture
  • Next by Date: Re:Date coersion
  • Previous by thread: Re: Preparing a lecture
  • Next by thread: Re:Date coersion
  • Index(es):
    • Date
    • Thread