Date.setTimezone
$date.setTimezone($timezoneName) -> null
Description
Set the timezone of the Date object.
See the List of Supported Timezones.
By default, dates are created with the timezone
set in app.jcon
(default is UTC
).
NoteWe recommend UTC as the timezone when storing all dates internally, in order to factor away bugs related to Daylight Savings Time, etc. You can then set a custom timezone when displaying dates to the user.
$date = Date.now() //= 《 Date 2021-05-07 16:42:16 +0000 》 $date.setTimezone('Europe/Helsinki') //= 《 Date 2021-05-07 19:41:16 +0300 》