Re: date/Snow Leopard changed
Re: date/Snow Leopard changed
- Subject: Re: date/Snow Leopard changed
- From: Doug Tallman <email@hidden>
- Date: Sun, 6 Sep 2009 16:23:17 -0400
Another Date/Time question. How come AppleScript Editor sees "month"
and "day" differently.
"month" and "date" are formatted as classes
"day" and "year" are formatted as properties.
You'd think "month" "day" and "year" would all be properties. Is month
different because January, etc. are constants?
doug
On Sep 6, 2009, at 4:10 PM, Mark J. Reed wrote:
And how do you detect that? The point is, the date locale setting that
matters is the one at runtime, not compile time. So any function that
dynamically builds and parses a date string has to deal with all the
possible locale settings on all the systems where the script is
ultimately run. No big deal if you're the only one who runs the
scripts you write, but otherwise...
On 9/6/09, Doug Tallman <email@hidden> wrote:
Of course, if the system is dd/mm/yyyy the function would be:
on newDate (d,m,y)
::)
My point was to avoid the issue with Sept. 29 and February.
Alternatively one could:
on newDate(m, d, y)
set new_date to date "01/01/01"
set month of new_date to m
set day of new_date to d
set year of new_date to y
return new_date
end newDate
newDate(12, 25, 1973)
On Sep 6, 2009, at 1:34 PM, Yvan KOENIG wrote:
Le 6 sept. 2009 à 19:28:21, Doug Tallman a écrit :
on newDate(m, d, y)
set new_date to date ((m as string) & ¬
"/" & (d as string) & "/" & (y as string))
return new_date
end newDate
newDate(12, 25, 1973)
Which valid only for systems using mm/dd/yyyy date format.
If the system uses dd/mm/yyyy date format it must be edited as:
on newDate( d, m, y)
set new_date to date ((m as string) & ¬
"/" & (d as string) & "/" & (y as string))
return new_date
end newDate
newDate(12, 25, 1973)
Yvan KOENIG (VALLAURIS, France) dimanche 6 septembre 2009 19:34:16
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Sent from my mobile device
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden