
datetime (Transact-SQL) - SQL Server | Microsoft Learn
The following tables list the supported string literal formats for datetime. Except for ODBC, datetime string literals are in single quotation marks ('), for example, 'string_literaL'.
Date and Time Data Types and Functions - SQL Server (Transact …
Date and time functions The following tables list the Transact-SQL date and time functions. For more information about determinism, see Deterministic and Nondeterministic Functions.
FORMAT (Transact-SQL) - SQL Server | Microsoft Learn
For a full explanation of these formatting patterns, consult the .NET Framework documentation on string formatting in general, custom date and time formats, and custom number formats.
date (Transact-SQL) - SQL Server | Microsoft Learn
Datetime data types allow dates in the Gregorian format to be stored in the date range 0001-01-01 CE through 9999-12-31 CE. The default string literal format, which is used for down-level …
CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learn
Reference for the CAST and CONVERT Transact-SQL functions. These functions convert expressions from one data type to another.
datetime2 (Transact-SQL) - SQL Server | Microsoft Learn
The following tables list the supported ISO 8601 and ODBC string literal formats for datetime2. For information about alphabetical, numeric, unseparated, and time formats for the date and …
SET DATEFORMAT (Transact-SQL) - SQL Server | Microsoft Learn
The DATEFORMAT setting may interpret character strings differently for date data types, depending on their string format. For example, datetime and smalldatetime interpretations may …
Date and Time Data - ADO.NET | Microsoft Learn
You can specify date and time data types by using a variety of different literal string formats, which SQL Server then evaluates at runtime, converting them to internal date/time structures.
time (Transact-SQL) - SQL Server | Microsoft Learn
When you convert to date and time data types, SQL Server rejects all values it cannot recognize as dates or times. For information about using the CAST and CONVERT functions with date …
Date and time types - SQL Server | Microsoft Learn
Nov 18, 2025 · Related content Date and time data types and functions (Transact-SQL) AT TIME ZONE (Transact-SQL) CAST and CONVERT (Transact-SQL)