Other Wiki Sections

Time Database Columns in .NET

With SQL Server 2008 came (among other things), a new data type: time. By default a time field gets imported into Visual Studio as a TimeSpan .NET type. However, the TimeSpan type doesn't format in the familiar way that a DateTime does. This article describes how to format a TimeSpan using the same format string as for a DateTime.