Skip to content

Commit c1fe6db

Browse files
authored
Merge pull request MicrosoftDocs#3027 from BYHAM/patch-400
Date and time, formatting.
2 parents 50011c9 + 65ea003 commit c1fe6db

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

docs/t-sql/functions/date-and-time-data-types-and-functions-transact-sql.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Date and Time Data Types and Functions (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "07/29/2017"
4+
ms.date: "09/01/2017"
55
ms.prod: "sql-non-specified"
66
ms.reviewer: ""
77
ms.suite: ""
@@ -40,8 +40,8 @@ The following sections in this topic provide an overview of all [!INCLUDE[tsql](
4040
- [Functions That Validate Date and Time Values](#ValidateDateandTimeValues)
4141
- [Date and Time–Related Topics](#DateandTimeRelatedTopics)
4242

43-
## <a name="DateandTimeDataTypes"></a> Date and Time data tyes
44-
The [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types are listed in the following table.
43+
## <a name="DateandTimeDataTypes"></a> Date and Time data types
44+
The [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types are listed in the following table:
4545

4646
|Data type|Format|Range|Accuracy|Storage size (bytes)|User-defined fractional second precision|Time zone offset|
4747
|---|---|---|---|---|---|---|
@@ -53,7 +53,7 @@ The [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time data types are lis
5353
|[datetimeoffset](../../t-sql/data-types/datetimeoffset-transact-sql.md)|YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+&#124;-]hh:mm|0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999 (in UTC)|100 nanoseconds|8 to 10|Yes|Yes|
5454

5555
> [!NOTE]
56-
> The [!INCLUDE[tsql](../../includes/tsql-md.md)][rowversion](../../t-sql/data-types/rowversion-transact-sql.md) data type is not a date or time data type. **timestamp** is a deprecated synonym for **rowversion**.
56+
> The [!INCLUDE[tsql](../../includes/tsql-md.md)] [rowversion](../../t-sql/data-types/rowversion-transact-sql.md) data type is not a date or time data type. **timestamp** is a deprecated synonym for **rowversion**.
5757
5858
## <a name="DateandTimeFunctions"></a> Date and Time functions
5959
The [!INCLUDE[tsql](../../includes/tsql-md.md)] date and time functions are listed in the following tables. For more information about determinism, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
@@ -65,7 +65,7 @@ All system date and time values are derived from the operating system of the com
6565
[!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] obtains the date and time values by using the GetSystemTimeAsFileTime() Windows API. The accuracy depends on the computer hardware and version of Windows on which the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is running. The precision of this API is fixed at 100 nanoseconds. The accuracy can be determined by using the GetSystemTimeAdjustment() Windows API.
6666

6767
|Function|Syntax|Return value|Return data type|Determinism|
68-
|---|---|---|---|
68+
|---|---|---|---|--|
6969
|[SYSDATETIME](../../t-sql/functions/sysdatetime-transact-sql.md)|SYSDATETIME ()|Returns a **datetime2(7)** value that contains the date and time of the computer on which the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is running. The time zone offset is not included.|**datetime2(7)**|Nondeterministic|
7070
|[SYSDATETIMEOFFSET](../../t-sql/functions/sysdatetimeoffset-transact-sql.md)|SYSDATETIMEOFFSET ( )|Returns a **datetimeoffset(7)** value that contains the date and time of the computer on which the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is running. The time zone offset is included.|**datetimeoffset(7)**|Nondeterministic|
7171
|[SYSUTCDATETIME](../../t-sql/functions/sysutcdatetime-transact-sql.md)|SYSUTCDATETIME ( )|Returns a **datetime2(7)** value that contains the date and time of the computer on which the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is running. The date and time is returned as UTC time (Coordinated Universal Time).|**datetime2(7)**|Nondeterministic|
@@ -84,25 +84,25 @@ All system date and time values are derived from the operating system of the com
8484
|--------------|------------|------------------|----------------------|-----------------|
8585
|[DATENAME](../../t-sql/functions/datename-transact-sql.md)|DATENAME ( *datepart* , *date* )|Returns a character string that represents the specified *datepart* of the specified date.|**nvarchar**|Nondeterministic|
8686
|[DATEPART](../../t-sql/functions/datepart-transact-sql.md)|DATEPART ( *datepart* , *date* )|Returns an integer that represents the specified *datepart* of the specified *date*.|**int**|Nondeterministic|
87-
|[DAY](../../t-sql/functions/day-transact-sql.md)|DAY ( *date* )|Returns an integer that represents the day day part of the specified *date*.|**int**|Deterministic|
87+
|[DAY](../../t-sql/functions/day-transact-sql.md)|DAY ( *date* )|Returns an integer that represents the day part of the specified *date*.|**int**|Deterministic|
8888
|[MONTH](../../t-sql/functions/month-transact-sql.md)|MONTH ( *date* )|Returns an integer that represents the month part of a specified *date*.|**int**|Deterministic|
8989
|[YEAR](../../t-sql/functions/year-transact-sql.md)|YEAR ( *date* )|Returns an integer that represents the year part of a specified *date*.|**int**|Deterministic|
9090

9191
### <a name="fromParts"></a> Functions that get Date and Time values from their parts
9292

9393
|Function|Syntax|Return value|Return data type|Determinism|
94-
|---|---|---|---|
94+
|---|---|---|---|---|
9595
|[DATEFROMPARTS](../../t-sql/functions/datefromparts-transact-sql.md)|DATEFROMPARTS ( *year*, *month*, *day* )|Returns a **date** value for the specified year, month, and day.|**date**|Deterministic|
96-
|[DATETIME2FROMPARTS](../../t-sql/functions/datetime2fromparts-transact-sql.md)|DATETIME2FROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *fractions*, *precision* )|Returns a **datetime2** value for the specified date and time and with the specified precision.|**datetime2(** *precision* **)**|Deterministic|
97-
|[DATETIMEFROMPARTS](../../t-sql/functions/datetimefromparts-transact-sql.md)|DATETIMEFROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *milliseconds* )|Returns a **datetime** value for the specified date and time.|**datetime**|Deterministic|
98-
|[DATETIMEOFFSETFROMPARTS](../../t-sql/functions/datetimeoffsetfromparts-transact-sql.md)|DATETIMEOFFSETFROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *fractions*, *hour_offset*, *minute_offset*, *precision* )|Returns a **datetimeoffset** value for the specified date and time and with the specified offsets and precision.|**datetime(** *precision* **)**|Deterministic|
96+
|[DATETIME2FROMPARTS](../../t-sql/functions/datetime2fromparts-transact-sql.md)|DATETIME2FROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *fractions*, *precision*)|Returns a **datetime2** value for the specified date and time and with the specified precision.|**datetime2(** *precision* **)**|Deterministic|
97+
|[DATETIMEFROMPARTS](../../t-sql/functions/datetimefromparts-transact-sql.md)|DATETIMEFROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *milliseconds*)|Returns a **datetime** value for the specified date and time.|**datetime**|Deterministic|
98+
|[DATETIMEOFFSETFROMPARTS](../../t-sql/functions/datetimeoffsetfromparts-transact-sql.md)|DATETIMEOFFSETFROMPARTS ( *year*, *month*, *day*, *hour*, *minute*, *seconds*, *fractions*, *hour_offset*, *minute_offset*, *precision*)|Returns a **datetimeoffset** value for the specified date and time and with the specified offsets and precision.|**datetime(** *precision* **)**|Deterministic|
9999
|[SMALLDATETIMEFROMPARTS](../../t-sql/functions/smalldatetimefromparts-transact-sql.md)|SMALLDATETIMEFROMPARTS ( *year*, *month*, *day*, *hour*, *minute* )|Returns a **smalldatetime** value for the specified date and time.|**smalldatetime**|Deterministic|
100100
|[TIMEFROMPARTS](../../t-sql/functions/timefromparts-transact-sql.md)|TIMEFROMPARTS ( *hour*, *minute*, *seconds*, *fractions*, *precision* )|Returns a **time** value for the specified time and with the specified precision.|**time(** *precision* **)**|Deterministic|
101101

102102
### <a name="GetDateandTimeDifference"></a> Functions that get Date and Time difference
103103

104104
|Function|Syntax|Return value|Return data type|Determinism|
105-
|---|---|---|---|
105+
|---|---|---|---|---|
106106
|[DATEDIFF](../../t-sql/functions/datediff-transact-sql.md)|DATEDIFF ( *datepart* , *startdate* , *enddate* )|Returns the number of date or time *datepart* boundaries that are crossed between two specified dates.|**int**|Deterministic|
107107
|[DATEDIFF_BIG](../../t-sql/functions/datediff-big-transact-sql.md)|DATEDIFF_BIG ( *datepart* , *startdate* , *enddate* )|Returns the number of date or time *datepart* boundaries that are crossed between two specified dates.|**bigint**|Deterministic|
108108

0 commit comments

Comments
 (0)