date format question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike P

    #1

    date format question

    How do I manage to get my date in the format Monday, 23rd July 2003? I
    am currently using the code below to get Monday, 23 July 2003, but I
    can't figure out how to get the day followed by st, rd, th etc.

    datetime.Text = DateTime.Now.To String("dddd, dd MMMM yyyy")

    Any assistance would be much appreciated.


    Cheers,


    Mike


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Mikael

    #2
    Re: date format question

    Try datetime.Text = DateTime.Now.To String("f");

    You can also look up DateTime.ToStri ng in the .NET Framework docs for more
    formatting alternatives.

    //Mikael

    "Mike P" <mrp@telcoelect ronics.co.uk> skrev i meddelandet
    news:eIf2XjpUDH A.2104@TK2MSFTN GP10.phx.gbl...[color=blue]
    > How do I manage to get my date in the format Monday, 23rd July 2003? I
    > am currently using the code below to get Monday, 23 July 2003, but I
    > can't figure out how to get the day followed by st, rd, th etc.
    >
    > datetime.Text = DateTime.Now.To String("dddd, dd MMMM yyyy")
    >
    > Any assistance would be much appreciated.
    >
    >
    > Cheers,
    >
    >
    > Mike
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    Working...