get_internal_date

Description

Returns the current date and time from the internal clock maintained by Adaptive Server.

Syntax

get_internal_date

Examples

Example 1

The system clock is synchronized with the Adaptive Server internal clock. Current system date: January 20, 2007, 5:04AM:

select get_internal_date()
Jan 20 2007 5:04AM 

Example 2

The system clock is not synchronized with the Adaptive Server internal clock. Current system date: August 27, 2007, 1:08AM.

select get_internal_date()
Aug 27 2007 1:07AM

Usage

get_internal_date may return a different value than getdate. getdate returns the system clock value, while get_internal_date returns the value of the server’s internal clock.

At startup, Adaptive Server initializes its internal clock with the current value of the operating system clock, and increments it based on regular updates from the operating system.

Adaptive Server periodically synchronizes the internal clock with the operating system clock. The two typically differ by a maximum of one minute.

Adaptive Server uses the internal clock value to maintain the date of object creation, timestamps for transaction log records, and so on. To retrieve such values, use get_internal_date rather than getdate.

Permissions

Any user can execute get_internal_date

See also

getdate