Prasad Godbole

Prasad Godbole

  • NA
  • 153
  • 170.8k

Date Time conversion

May 2 2011 7:03 AM
Hi ,

I am converting MM/dd/yyyy date to yyyy-MM-dd hh:mm:ss using dateobject.ToString("yyyy-MM-dd hh:mm:ss").

Its converting perfectly in given format but in MM-dd-yyyy format there is no hour specified and hour is appearing in this yyyy-MM-dd hh:mm:ss format .

For e.g.  date is 05/07/2009   i.e. 7 May 2009 and after converting to yyyy-MM-dd hh:mm:ss format, date is appearing as 2009-05-07 12:00:00.

From where this 12 is appearing ? We don't want this 12 . The date should display like  2009-05-07 00:00:00.

Please suggest solution.

Thanks
Prasad


Answers (7)