create. Relative date

^date::create(number of days since EPOCH)

Constructor with only one parameter is designed for specifying relative date and time values. Having object of class
date, one can make up a new object of the same type, whose value will be shifted with respect to the initial.

Example
$now[^date::now[]]
$date_after_week[^date::create($now+
1)]

The example creates a date and time to come 24 hours after the current date and time.

Parameter of the constructor does not have to be an integer number.

$date_after_three_hours[^date::create($now+3/24)]


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 27.01.2021