11 System Clock

Returning the Current System Time and Date

There are two functions provided as part of the Eloquence language which return the current time and date. They are TIME$ and DATE$.

The TIME$ Function

The TIME$ function returns the current system time. Syntax for this function is as follows:

TIME$

TIME$ (format string)

When TIME$ is executed without an argument, it returns the configured value defined in the Eloquence configuration file "eloqd.cfg".

In addition, you can now specify an arbitrary format. The format depends on the operating system where Eloquence is running. On HP-UX see date(1) and strftime(3) for more information on the time format.

Example:

TIME$("%H:%M:%S")     --> returns 11:35:45

The DATE$ Function

The DATE$ function returns the current system date. Syntax for this function is as follows:

DATE$

DATE$(format string)

When DATE$ is executed without an argument, it returns the configured value defined in the Eloquence configuration file "eloqd.cfg".

In addition, you can now specify an arbitrary format. The format depends on the operating system where Eloquence is running. On HP-UX see date(1) and strftime(3) for more information on the time format.

Example:

DATE$("%Y-%m-%d %H:%M")   --> returns 1997-01-14 14:37.


Eloquence Language Manual - 19 DEC 2002