I am trying to save the current date time format from C# and convert it to an SQL Server date format like so yyyy-MM-dd HH:mm:ss so I can use it for my UP
yyyy-MM-dd HH:mm:ss
UP
Let's use the built in SqlDateTime class
new SqlDateTime(DateTime.Now).ToSqlString()
But still need to check for null values. This will throw overflow exception
new SqlDateTime(DateTime.MinValue).ToSqlString()
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.