DATETIME Function

Purpose

Returns a character string that represents the system date and time of day.

Syntax

DATETIME

or

DATETIME ([x])

The second form can be used only when DATETIME has been declared with the BUILTIN attribute.

Parameters

x
An expression that specifies an optional date/time pattern in which the date is returned. The default is 'YYYYMMDDHHMISS999'. x must have computational type and should have character type. Otherwise, it is converted to character.

Description

The DATE function returns a character string of length 17 that represents the system date in the form yyyymmddhhmmssttt, where:

String Range Represents
yyyy      0000–9999     year
mm 01–12 month
dd 01–31 day
hh 00–23 hour
mm 00–59 minute
ss 00–59 second
ttt 000–999 millisecond

You may also define the LPI_YEAR environment variable to return any year value you want (such as 2009).

If you are using Bourne shell, do this:

LPI_YEAR=2009;
export LPI_YEAR

If you are using C-shell, do this:

setenv LPI_YEAR 2009;

Examples

DATETIME()  /* returned '19940526163111585' on May 26, 
                   1994 at 11.585 seconds after 4:31 PM */

Restrictions

None.