method in-timezone
1 | class DateTime |
1.1 | (DateTime) method in-timezone |
Documentation for method in-timezone
assembled from the following types:
class DateTime
From DateTime
(DateTime) method in-timezone
Defined as:
method in-timezone(DateTime: Int(Cool) = 0 --> DateTime)
Returns a DateTime object for the same time, but in the specified $timezone
, which is the offset in seconds from GMT.
say DateTime.new('2015-12-24T12:23:00Z').in-timezone(3600 + 1800); # OUTPUT: «2015-12-24T13:53:00+0130»
Per RFC 7164, leap seconds do not respect local time and always occur at the end of the UTC day:
say DateTime.new: '2017-01-01T00:59:60+01:00'# OUTPUT: «2017-01-01T00:59:60+01:00»