get_appcontext  getutcdate

Chapter 2: Transact-SQL Functions

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





Copyright © 2005. Sybase Inc. All rights reserved. getutcdate

View this book as PDF