getdate

Description

Returns the current system date and time.

Syntax

getdate()

Parameters

None.

Examples

Example 1

select getdate()

Nov 25 1995 10:32AM

Example 2

select datepart(month, getdate())

1

Example 3

These examples assume a current date of November 25, 1995, 10:32 a.m.:

select datename(month, getdate())

November

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute getdate.

See also

Datatypes Date and time datatypes.

Functions dateadd, datediff, datename, datepart