current_time

Description

Returns the current time.

Syntax

current_time()

Parameters

None.

Examples

Example 1

Finds the current time:

1> select current_time()
2> go
------------------------ 
            12:29PM

(1 row affected)

Example 2

Use with datename:

1> select datename(minute, current_time())
2> go
------------------------------ 
45

(1 row affected)

Usage

Finds the current time as it exists on the server

Standards

ANSI SQL – Compliance level: Entry-level compliant.

Permissions

Any user can execute current_time.

See also

Datatypes Date and time datatypes

Commands select, where clause

Functions dateadd, datename, datepart, getdate