Bineesh Viswanath

Bineesh Viswanath

  • 1.3k
  • 428
  • 43.7k

C# code to save datetime format in 01/01/1900 hh:mm:ss

Dec 14 2017 7:16 AM
Dear,
 
I am in a winform project and needed help from someone on below issue.
 
I need a datetime format of  01/01/1900 hh:mm:ss to insert into table.
 
 
The current below code not working for me with output - 2017-12-14 16:07:40.000

string.Format("{0:hh:mm:ss}", DateTime.Now.ToString());

format needed :- 1900-01-01 16:07:40.000.
 
Thank you.
 

Answers (4)