datetime conversion

  • Thread starter Thread starter Vaj
  • Start date Start date
V

Vaj

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.
 
Vaj said:
I need to convert the datetime "10/10/2003 20:30:20 AM" to 10/10/2003 .

Can anyone help me to solve this.

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.ParseExact to parse it, then
DateTime.ToString with another format string to format it.
 
Back
Top