MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List of Month Names

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93614] Re: [mg93597] List of Month Names
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Tue, 18 Nov 2008 07:20:27 -0500 (EST)
  • Organization: LANL
  • References: <200811171117.GAA22193@smc.vnet.net>
  • Reply-to: cfo at lanl.gov

I wish I could answer in the affirmative. In lieu, here's an ugly hackaround, but it's not a "short" command:

      months =    SortBy[Union[(DateString[#1, "MonthName"] & ) /@ 
       (DateList[] + {0, #1, 0, 0, 0, 0} & ) /@ Range[13]], 
   DateDifference["January", #1] & ]

  (*  create a list of month names by adding 1 successively to the current date. Do this 13 times to possibly account for strange effects due to leapyears, then Union to get rid of duplicate month names. Then use SortBy to get a canonical "January", "February", ... ordering.  *)

   (* something analogous may be done to extract names of the days, but I can't figure out a quick sorting function:  *)

dayNames = Union[(DateString[#1, "DayName"] & ) /@ 
       (DateList[] + {0, 0, #1, 0, 0, 0} & ) /@ Range[7]]


                       Know it doesn't help, but hope it does, anyway, 
                                                                      Curtis O.




On Monday 17 November 2008 04:17:30 David Park wrote:
> Is there a short Mathematica command to obtain a list of month names or
> short month names in order, without having to type them all in by hand? And
> same question for days of the week.
> 
> Thanks in advance.
> 
> David Park
> 
> djmpark at comcast.net
> 
>  <http://home.comcast.net/~djmpark> http://home.comcast.net/~djmpark 
> 
> 
> 
> 



-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • Prev by Date: Re: Working with vectors symbolically
  • Next by Date: Re: Re: Creating a Banner for presentation
  • Previous by thread: Re: List of Month Names
  • Next by thread: Re: List of Month Names