How to get JUST month name from a date?

Discussion in 'ASP .Net' started by VB Programmer, Nov 10, 2004.

  1. I have a date (such as 10/1/2004). How do I convert it to just "October"?
    Thanks.
     
    VB Programmer, Nov 10, 2004
    #1
    1. Advertising

  2. Use format string "MMMM".

    Eliyahu

    "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    news:...
    > I have a date (such as 10/1/2004). How do I convert it to just "October"?
    > Thanks.
    >
    >
     
    Eliyahu Goldin, Nov 10, 2004
    #2
    1. Advertising

  3. VB Programmer

    Shiva Guest

    DateTime.ToString ("MMMM")

    "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    news:...
    I have a date (such as 10/1/2004). How do I convert it to just "October"?
    Thanks.
     
    Shiva, Nov 10, 2004
    #3
  4. VB Programmer

    mortb Guest

    Something like:

    Dim MyString As String = "10/1/2004"
    Dim MyDateTime As DateTime = DateTime.Parse(MyString, new
    CultureInfo("en-US"))
    Dim Month As String = MyDateTime.ToString("MMMM", new CultureInfo("en-US"))

    "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    news:...
    >I have a date (such as 10/1/2004). How do I convert it to just "October"?
    >Thanks.
    >
     
    mortb, Nov 10, 2004
    #4
  5. Thanks EVERYONE! Great response and great newsgroup.

    "mortb" <mortb1<noospam<@hotmail.com> wrote in message
    news:...
    > Something like:
    >
    > Dim MyString As String = "10/1/2004"
    > Dim MyDateTime As DateTime = DateTime.Parse(MyString, new
    > CultureInfo("en-US"))
    > Dim Month As String = MyDateTime.ToString("MMMM", new
    > CultureInfo("en-US"))
    >
    > "VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
    > news:...
    >>I have a date (such as 10/1/2004). How do I convert it to just "October"?
    >>Thanks.
    >>

    >
    >
     
    VB Programmer, Nov 10, 2004
    #5
  6. VB Programmer

    sbjmagic

    Joined:
    Oct 14, 2009
    Messages:
    1
    Location:
    Bihar
    How to get JUST month name from a date ???

    Dim SalaryDate as DateTime
    Dim MonthName as String

    SalaryDate='03/11/2009'

    MonthName = SalaryDate.ToString("MMMM")

    It will Return 'November'

    Thnx

    By Shashi....
     
    sbjmagic, Oct 14, 2009
    #6
  7. VB Programmer

    bernardes

    Joined:
    Jun 29, 2011
    Messages:
    1
    VBA - Convert numbers to month names

    (Sorry comments only in portuguese, but the code is very simple)

    Solution here.

    Tags: André Luiz Bernardes, MS, Microsoft, Office, VBA, Access, Excel, Word, Outlook, Sharepoint, convert, YTD, QTD, MAT, MTD, Month, Mês, converter

    André Luiz Bernardes

    http://inanyplace.blogspot.com/
    Santos - SP - Brazil
     
    bernardes, Jun 29, 2011
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michal Maciejczak
    Replies:
    1
    Views:
    1,998
    Matthias Kaeppler
    Apr 23, 2005
  2. Replies:
    1
    Views:
    466
    Steve W. Jackson
    Dec 22, 2006
  3. Mufasa
    Replies:
    0
    Views:
    408
    Mufasa
    Sep 5, 2008
  4. VYAS ASHISH M-NTB837

    RE: Convert month name to month number faster

    VYAS ASHISH M-NTB837, Jan 6, 2010, in forum: Python
    Replies:
    0
    Views:
    631
    VYAS ASHISH M-NTB837
    Jan 6, 2010
  5. Steven D'Aprano

    Re: Convert month name to month number faster

    Steven D'Aprano, Jan 6, 2010, in forum: Python
    Replies:
    0
    Views:
    495
    Steven D'Aprano
    Jan 6, 2010
Loading...

Share This Page