getdate

Description

Returns the current system date and time.

Syntax

getdate()

Parameters

None.

Examples

Example 1

Assumes a current date of November 25, 1995, 10:32 a.m.:

select getdate()
Nov 25 1995 10:32AM

Example 2

Assumes a current date of November:

select datepart(month, getdate())
11

Example 3

Assumes a current date of November:

select datename(month, getdate())
November

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute getdate.

See also

Datatypes Date and time datatypes

Functions dateadd, datediff, datename, datepart