Hello guys,
I get this time from DateTime.Now "6/12/2009 11:45:28 AM" and I need to convert it ISO 8601 which is the one that SQL accepts "2009-12-06 11:45:28".
What can I do?
Printable View
Hello guys,
I get this time from DateTime.Now "6/12/2009 11:45:28 AM" and I need to convert it ISO 8601 which is the one that SQL accepts "2009-12-06 11:45:28".
What can I do?
I found a way to do this
but I need to do this in 1 step because I send this time by parameters, i,e:Code:DateTime lastTime = DateTime.Now;
string x = lastTime.ToString("u").Replace("Z", "");
And I would like to send the time through itCode:Insert(DateTime.Now);
solved
Code:Insert(DateTime.Now.ToString("u").Replace("Z", ""));