ToReversedDateTime
Takes a DateTime object and reverses it to an SQL type string (yyyy-mm-dd hh:MM:ss)
Source
internal static string ToReversedDateTime(this DateTime value)
{
return string.Format("{0:u}", value);
}
Example
string reversed = DateTime.Now.ToReversedDateTime();