converting dates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    converting dates

    How can I convert '07/04/03' to 'July 4, 2003'?
    thanks,
    VM


  • Bill Priess

    #2
    Re: converting dates

    string newDate = DateTime.Parse( "07/04/03").ToLongDate String();

    (You may need to do a String.Format() on it, but I am not sure)

    HTH,

    Bill P.
    <VM> wrote in message news:%23YcAorlR DHA.2188@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > How can I convert '07/04/03' to 'July 4, 2003'?
    > thanks,
    > VM
    >
    >[/color]


    Comment

    • Allen Jones

      #3
      Re: converting dates

      That will give you the day of week as well.

      Try:

      string s = DateTime.Parse( "07/04/03").ToString(" MMMM dd, yyyy");

      Look at the System.Globaliz ation.DateTimeF ormatInfo Class for a description
      of the formatting string elements.

      Regards
      Allen

      "Bill Priess" <no.spam@nospam .com> wrote in message
      news:excBKylRDH A.2636@TK2MSFTN GP10.phx.gbl...[color=blue]
      > string newDate = DateTime.Parse( "07/04/03").ToLongDate String();
      >
      > (You may need to do a String.Format() on it, but I am not sure)
      >
      > HTH,
      >
      > Bill P.
      > <VM> wrote in message news:%23YcAorlR DHA.2188@TK2MSF TNGP10.phx.gbl. ..[color=green]
      > > How can I convert '07/04/03' to 'July 4, 2003'?
      > > thanks,
      > > VM
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...