» Documentation » SQL Reference

Date Functions

__NOTOC__ These functions can manipulate datetime columns and values.

In the following functions, date_unit must be one of the following:

year, month, day, hour, minute, or second.

GETDATE

Syntax

GETDATE() 

Returns the current system time.

DATEADD

Syntax

DATEADD('date_unit',number,date) 

Returns date plus number date_units.

DATEDIFF

Syntax

DATEDIFF('date_unit', date0, date1) 

Returns the amount of time between date0 and date1 in date_unit's.

DATEPART

Syntax

DATEPART('date_unit',date) 

Returns the date_unit component of date.