dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Convert Month number to Month name (string)???

  1. #1
    Join Date
    Aug 2006
    Posts
    5

    Convert Month number to Month name (string)???

    What would be the best way to convert a month number to its corresponding
    string? I.e, 3 -> 'March'.

    Can I do this without using an array? I'm really tired of those right now. LOL.

    I have a search function and the values of my months are in numbers so that they can be ordered correctly, but I need them to be displayed using their names, not numbers.

    Any help would be much appreciated.

    thanks!

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    The .NET Framework has built-in functions to convert month numbers to names in numerous languages, so if you were using ASP.NET you wouldn't have to write any code. In ASP, however, I think you'll have use an array. Sorry! :-)
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2006
    Posts
    5
    well i guess the reason why i can't use an array is because i'm a novice and i BARELY have a loose grasp on arrays. can you help me with that?

  4. #4
    Join Date
    Mar 2004
    Location
    UK
    Posts
    31
    If you're using VBScript, you can use the MonthName function:
    http://msdn.microsoft.com/library/en...63a9bdb241.asp

    E.g:
    MonthName(3) returns "March"
    MonthName(3, True) returns "Mar"

    You can download the VBScript documentation from:
    http://www.microsoft.com/downloads/d...displaylang=en

Similar Threads

  1. SQL DMO Restores in VB?
    By ObiWan in forum VB Classic
    Replies: 3
    Last Post: 05-23-2006, 10:35 AM
  2. NumberFormatException
    By airrazor in forum Database
    Replies: 1
    Last Post: 10-29-2005, 10:13 AM
  3. App Object
    By Rob Teixeira in forum .NET
    Replies: 15
    Last Post: 05-31-2002, 03:30 PM
  4. Need to Convert a Hex string to a Hex number
    By Dan Fergus in forum .NET
    Replies: 3
    Last Post: 08-23-2001, 01:39 PM
  5. verify local admin
    By Patrick Comeau in forum VB Classic
    Replies: 6
    Last Post: 03-22-2001, 11:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center