datetime conversion

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

    #1

    datetime conversion

    Hi,
    I need to convert the datetime "10/10/2003 20:30:20 AM" to 10/10/2003 .

    Can anyone help me to solve this.

    Thanks vinitha.


  • Jon Skeet [C# MVP]

    #2
    Re: datetime conversion

    Vaj <vinitha_k@hotm ail.com> wrote:[color=blue]
    > I need to convert the datetime "10/10/2003 20:30:20 AM" to 10/10/2003 .
    >
    > Can anyone help me to solve this.[/color]

    Well that's quite a strange time to start with - you've got a 24 hour
    clock, but you're specifying "AM" as well. In other words, that time is
    8pm in the morning!

    When you've worked out what format you actually mean, use
    DateTime.Parse or DateTime.ParseE xact to parse it, then
    DateTime.ToStri ng with another format string to format it.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    Working...