Re: Coerce time
Re: Coerce time
- Subject: Re: Coerce time
- From: Nigel Smith <email@hidden>
- Date: Thu, 21 Aug 2003 11:21:18 +0100
On 20/8/03 20:42, "Rich Carroll" <email@hidden> wrote:
>
Is there a simple way to coerce "August 20, 2003" to 08/20/03?
Just to add one more to the mix:
--so you can test
set theDate to date (text returned of (display dialog "" default answer ""))
--we'll find the offset from this list, the bogus first 3 characters just
--saves us from having to add 1 later
set theMonths to "***JanFebMarAprMayJunJulAugSepOctNovDec"
--this is all one line
return ("" & ((offset of (characters 1 thru 3 of (month of <no-break>
theDate as string) as string) in theMonths) div 3) & "/" & <no-break>
day of theDate & "/" & year of theDate)
I'll leave the error catching to you...
Nigel
PS. Someone is going to to mention TIDs, string conversion and why not use
"text of characters 1 thru 3..."
Am I the only person who evaluates:
get text of characters 3 thru 7 of "Try this at home"
...and gets
{"y", " ", "t", "h", "i"}
...contradicting p64 of the ASLG?
_______________________________________________
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.
References: | |
| >Coerce time (From: Rich Carroll <email@hidden>) |