Re: date "Jan" --> date object
Re: date "Jan" --> date object
- Subject: Re: date "Jan" --> date object
- From: Chris Espinosa <email@hidden>
- Date: Thu, 14 Nov 2002 10:53:13 -0800
On Wednesday, November 13, 2002, at 05:03 PM, Mr Tea <email@hidden>
wrote:
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...
I just want to redirect some attribution here. This "utterly arcane
and esoteric, but all in plain English" functionality is actually
implemented by the StringToDate and StringToTime functions in Carbon
(see
http://developer.apple.com/techpubs/macosx/Carbon/text/
DateTimeUtilities/Date_Time_an_nt_Utilities/Functions/
Converting_D_resentations.html#//apple_ref/c/func/StringToDate ; watch
for wrapping in the above URL). And to boot this is implemented in OSA
proper, not AppleScript, so any OSA language (such as JavaScript) can
have the same functionality.
The one "feature" of the above functions that is the cause of all
foregoing discussion is noted in the documentation: "When one of the
components is missing, the component from the current date/time is used
by default."
I wish I could take some credit for the interesting side effects this
generates, but almost anything on the Mac that tries to convert a
string to a date using International Utilities will exhibit this exact
behavior.
Chris
_______________________________________________
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.