MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Paul Berkowitz <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 21 May 2003 13:39:38 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (28 lines)
On 5/21/03 1:03 PM, "Eric Schult" <[log in to unmask]> wrote:

> on 5/21/03 1:37 PM, Mark Munro wrote:
>
>> How about using unix to do that?
>>
>> do shell script "date '+%m.%d.%y'"
>
> I'm trying to coerce a string ("05212003") into a date (date "Wednesday, May
> 21, 2003 12:00:00 AM"). Can that be done with a variation of the syntax
> above?

If you're always going to use that exact format and have your own short date
settings in month/day/year order then this will work:

set theDate to "05212003"

set theDate to (text 1 thru 2 of theDate) & "/" & (text 3 thru 4 of theDate)
& "/" & text 5 thru -1 of theDate

set theDate to date theDate


But other people in the world will have it completely differently. That can
be arranged...
--
Paul Berkowitz

ATOM RSS1 RSS2