2
Reply

Formatting DateTime type , C#

Sheethal R A

Sheethal R A

Nov 19 2010 12:02 AM
16.2k
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)