Re: date "Jan" --> date object
Re: date "Jan" --> date object
- Subject: Re: date "Jan" --> date object
- From: Mr Tea <email@hidden>
- Date: Wed, 13 Nov 2002 22:29:52 +0000
This from Emmanuel - dated 131102 01.02 pm:
>
--------------------------------------------
>
date "when may I do whatever I want?"
>
--> May 1st
>
--------------------------------------------
While playing with this, I discovered what I thought was interesting
behaviour on the part of AppleScript when dealing with date ambiguity...
date ("Jan is 23") of (current date)
--> date "Wednesday, January 23, 2002 09.50.27 pm"
-- ie, Jan 23rd at current time on day of compilation
date ("" & "On her next birthday Jan will be 23")
-->date "Wednesday, November 13, 2002 11.00.00 pm"
-- ie, the 23rd hour of the day of compilation
date ("" & "In a couple of years Jan will be 25")
-->date "Friday, January 25, 2002 12.00.00 am"
In the latter two examples, note that when the numerical value coerced from
the string is above 24 it is treated as the day of the month, but when it's
24 or below it's treated as the hour of the day, and the month tidbit is
ignored. Things get more convoluted when additional numerical info is
included:
date ("" & "In 2 years, Jan will be 25")
-->date "Thursday, January 2, 2025 12.00.00 am"
date ("" & "Jan's 20th birthday was 3 years ago")
-->date "Monday, January 20, 2003 12.00.00 am"
So, now predict the result for these two:
date ("" & "BBEdit is up to version 6.5.3")
date ("" & "I wonder if it'll ever reach version 29.9.9")
This is the kind of applescript I like! Utterly arcane and esoteric, but all
in plain English.
Regards
Nick
(pp mrtea)
_______________________________________________
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.