Parameters
Date-time functions operate on date values and date-time values.
Type | Description |
---|---|
Date | A date. |
Datetime | A date and time. |
The following date-time functions are available:
See Also
Arguments
Many date-time functions use the arguments date, dateField and dateValue.
date
tbc
dateField
dateField can take one of the following values:
- _YEAR
- _MONTH
- _DAY (equivalent to _DAY_OF_MONTH)
- _DAY_OF_WEEK
- _DAY_OF_MONTH
- _DAY_OF_YEAR
- _WEEK_OF_YEAR
- _HOUR
- _MINUTE
- _SECOND
- _MILLISECOND
dateValue
dateValue can either be a number, representing a month or day, or a constant.
For example, to add three months to the current date and time, use:
dateAdd(now(), _MONTH, 3)
The constants are:
- _MONDAY
- _TUESDAY
- _WEDNESDAY
- _THURSDAY
- _FRIDAY
- _SATURDAY
- _SUNDAY
- _JANUARY
- _FEBRUARY
- _MARCH
- _APRIL
- _MAY
- _JUNE
- _JULY
- _AUGUST
- _SEPTEMBER
- _OCTOBER
- _NOVEMBER
- _DECEMBER
For example, if you want to set the day to Sunday, use:
dateSet(in.date, _DAY_OF_WEEK, _SUNDAY)
Months and Days as Numbers
The numbers returned by data functions:
- for the months are 1 for January through to 12 for December.
- for the days are:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
For example, the following returns 6, for Saturday:
dateGet("01/07/2017", _DAY_OF_WEEK)
When scheduling tasks, the days of the week are represented by different numbers.
See Also