Re: Month as Integer
Re: Month as Integer
- Subject: Re: Month as Integer
- From: Pier Kuipers <email@hidden>
- Date: Wed, 29 Nov 2000 18:41:07 +0000
>
I know that
>
>
month of (current date) as string
>
-- "November"
>
>
came in with OS 8.6 or 9.0 (which?).
>
>
I find that I can also get
>
>
month of (current date) as integer
>
-- 11
>
>
Is this a vanilla coercion with 8.6 or 9.0 as well, or is some osax helping
>
me out here, does anyone know?
>
>
--
>
Paul Berkowitz
That's gotta be an osax, because I get an error "can't make November
into a integer".
Here's what I use to get the month's number:
on GetMonthNumber()
set theMonth to month of (current date)
set theMonthList to {January, February, March, April, May, June,
July, August, September,
October, November, December}
set x to 1
repeat with i from 1 to 12
if (item x of theMonthList) is (theMonth) then
set y to x
exit repeat
else
set x to x + 1
end if
end repeat
set theMonthNumber to x
end GetMonthNumber
Remember to put the items of theMonthList on one line.
Pier.
--
---
Visual ID
A new concept in the storage
and distribution of corporate and
brand identity
http://www.visualid.com
Pier Kuipers
Visual ID
2 Whitefriars
Aungier Street
Dublin 2
Tel. +353 1 476 7059
Fax +353 1 478 1366
Mobile +353 87 294 3063
ISDN +353 1 602 0754