T M
class X::DateTime::TimezoneClash
Error ReportCollection examples

Error due to using both time zone offset and :timezone

class X::DateTime::TimezoneClash does X::Temporal is Exception { }

This exception is thrown when code tries to create a DateTime object specifying both a time zone offset and the named argument :timezone.

say DateTime.new('2015-12-24T12:23:00+0200');                   # works 
say DateTime.new('2015-12-24T12:23:00'timezone => 7200);      # works 
say DateTime.new('2015-12-24T12:23:00+0200'timezone => 7200); # exception 

Methods

sub message Defined as:

method message()

Returns 'DateTime.new(Str): :timezone argument not allowed with a timestamp offset'