• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Month as Integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Month as Integer (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Quitting an applet?
  • Next by Date: Re: Quitting an applet?
  • Previous by thread: Re: Month as Integer
  • Next by thread: RE: Month as Integer
  • Index(es):
    • Date
    • Thread