date() function

The date() function returns the current system date in internal format as an integer number representing the number of days that have elapsed since December 31, 1967 (day 0 on the D3 calendar).

Syntax

date()

Description

The parentheses following the function are required, and must not contain arguments. Without the parentheses, date is assumed to be a variable.

Example(s)

This calculates the number of days elapsed between the value of invoice.date and the current system date.

number.days = date() - invoice.date

This calculates the number of weeks elapsed between the value of invoice.date and the current system date.

weeks.old = (date() - invoice.date) / 7