• 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: Nigel Garvey <email@hidden>
  • Date: Fri, 1 Dec 2000 00:11:49 +0000

Johan Solve wrote on Thu, 30 Nov 2000 09:19:39 +0100:

>Would it be possible to do something like this:
>
>on GetMonthNumber()
> set theMonth to month of (current date)
> set theMonthList to {January:1, February:2, March:3, April:4, May:5, -+
> June:6, July:7, August:8, September:9, October:10, -+
> November:11, December:12}
> return themonth of themonthlist
>end GetMonthNumber
>
>I know it doesn't work as it stands but maybe it's just a matter of
>coding it right.
>'return November of themonthlist' works fine, so the question really
>is how you specify a named record by a variable? (wasn't this
>discussed recently? I think it was about using variable variable
>names but that should be related)

[Quotes from Pier Kuipers and Michelle Steiner]

That would be a very smart and fast method if it worked, though I'm
afraid I haven't been able to make it do so yet. The fastest and simplest
way of getting the month number that I know is that attributed to
Emmanuel Livy, which would look like this in the given handler:

on GetMonthNumber()
set theDate to (current date)
copy theDate to b
set the month of b to January
return 1 + (theDate - b + 1314864) div 2629728
end GetMonthNumber

NG


  • Follow-Ups:
    • Re: Month as Integer
      • From: Emmanuel <email@hidden>
  • Next by Date: Re: Month as Integer
  • Next by thread: Re: Month as Integer
  • Index(es):
    • Date
    • Thread