Date and time

Date and time#

Date and time functions operate on date and time values — adding intervals, extracting parts, and returning the current date and time.

Function

Description

DATEADD

Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date.

DATEDIFF

Returns the count (signed integer) of the specified datepart boundaries crossed between the specified startdate and enddate.

DATEFROMPARTS

Returns a date value for the specified year, month, and day.

DATENAME

Returns a character string that represents the specified datepart of the specified date.

DATEPART

Returns an integer that represents the specified datepart of the specified date.

DATETIME2FROMPARTS

Returns a datetime2 value for the specified date and time and with the specified precision.

DATETIMEFROMPARTS

Returns a datetime value for the specified date and time.

DAY

Returns an integer representing the day (day of the month) of the specified date.

EOMONTH

Returns the last day of the month that contains the specified date, with an optional offset.

GETDATE

Returns the current database system timestamp as a datetime value without the database time zone offset. This value is derived from the operating system of the computer on which the instance of Querona is running.

GETUTCDATE

Returns the current database system timestamp as a datetime value. The database time zone offset is not included. This value represents the current UTC time (Coordinated Universal Time). This value is derived from the operating system of the computer on which the instance of Querona is running.

ISDATE

Returns 1 if the expression is a valid date, time, or datetime value; otherwise, 0. ISDATE returns 0 if the expression is a datetime2 value.

MONTH

Returns an integer that represents the month of the specified date.

SMALLDATETIMEFROMPARTS

Returns a smalldatetime value for the specified date and time.

SYSDATETIME

Returns a datetime2(7) value that contains the date and time of the computer on which the instance of Querona is running.

SYSUTCDATETIME

Returns a datetime2 value that contains the date and time of the computer on which the instance of Querona is running. The date and time is returned as UTC time (Coordinated Universal Time). The fractional second precision specification has a range from 1 to 7 digits. The default precision is 7 digits.

TIMEFROMPARTS

Returns a time value for the specified time and with the specified precision.

TODATETIMEOFFSET

Returns a datetimeoffset value that is translated from a datetime2 expression.

YEAR

Returns an integer that represents the year of the specified date.