Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Date.setDate

$date.setDate($year, $month, $day) -> Date

Description

Set the date of the Date object, while keeping the same time.

$now = Date.now()
//= <Date 2021-05-10 01:02:30 +0000>

Date.now().setDate(2019, 3, 28)
//= <Date 2021-03-28 01:02:30 +0000>
//        ^^^^^^^^^^

See Also