TODAY()

From Lianjapedia
Revision as of 09:00, 2 October 2020 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to return current system date or a date from specified year, month and day values

Syntax

TODAY([<expN1>, <expN2>, <expN3>])

See Also

AMPM(), CDOW(), CMONTH(), CTOD(), CTOT(), DATE(), DATETIME(), DAY(), DAYS(), DMY(), DOW(), DTOA(), DTOC(), DTOM(), DTOS(), DTOT(), DTOV(), ELAPTIME(), EMPTY(), EPOCH(), GOMONTH(), HOUR(), HOURS(), ISLEAPYEAR(), LEAPYEARS(), LTOS(), MDY(), MINUTE(), MINUTES(), MONTH(), MTOD(), MTOS(), QUARTER(), SEC(), SECONDS(), SECS(), SET CENTURY, SET DATE, SET EPOCH, SET HOURS, SET MARK, SET SECONDS, STOD(), STOT(), STR(), STR_DATE(), STRFTIME(), TIME(), TIMEOFDAY(), TIMESTAMP(), TSTRING(), TTOC(), TTOD(), TYPE(), VAL(), VALIDTIME(), VTOD(), WEEK(), YEAR()

Description

The TODAY() function returns the current system date as a date type. The display format of dates is affected by the SET CENTURY, SET DATE, SET EPOCH and SET MARK set commands.

The optional <expN1>,<expN2>,<expN3> can be used to specify numeric years, months and days and return a valid corresponding date. If any parameter is invalid, an empty date is returned.

Parameter Description
<expN1> A valid number of years, -100 (1900) to 900 (2900)
<expN2> A valid number of months, 1 to 12
<expN3> A valid number of days, 1 to 31

The TODAY() function is a synonym of the DATE() function. From v5.4.

Example

? today()
04/04/2004
mdate = today()
? mdate
04/04/2004
? type("mdate")
D
? today(4,4,4)
04/04/2004