Construct date
Syntax
date($year, $month, $day)
Description
Constructs a date value representing a day of a year (in the system calendar). Compatible with tl.core:Date
values.
This value can be stored in attributes of type tl.core:Date
or can be further examined with toSystemCalendar.
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
year | Number | Year of the date | yes | |
month | Number | Month of the date. Counting starts from 0 (January = 0, February = 1 etc.) | yes | |
day | Number | Day of the date. Counting starts at 1 (1 = first day of the month) | yes |
Return value
Type: Business Object
A date value for the specified day of the year in the system calendar.
Examples
Note: The output may differ depending on the calendar's time zone.
Unformatted date
date(2012, 11, 31)
Output: 31.12.2012
Formatted date
dateFormat("dd-MM-yyy").format(date(2012, 11, 31))
Output: 30-12-2012