Sheethal R A

Sheethal R A

  • NA
  • 11
  • 67.9k

Formatting DateTime type , C#

Nov 19 2010 12:02 AM
i have a value of DateTime type.
i want to convert it to the below format.


TO_DATE('2010-11-18 16:45:55','YYYY-MM-DD HH24:MI:SS')

i am using,

DateTime dt1 = Convert.ToDateTime(fromDateTime).ToString("YYYY-MM-DD HH24:MI:SS");

its giving error tellin "Cannot implicitly convert type 'string' to 'System.DateTime'"


please help


Sheethal

Answers (2)