Documentation for routine infix:<+>

Documentation for routine infix:<+>, assembled from the following types:

class Date

From Date

(Date) sub infix:<+>

multi sub infix:<+> (Date:DInt:D --> Date:D)
multi sub infix:<+> (Int:DDate:D --> Date:D)

Takes an Int and adds that many days to the given Date object.

say'2015-12-25'+ 332# OUTPUT: «2016-11-21␤» 
say 1 +'2015-12-25');   # OUTPUT: «2015-12-26␤» 

class DateTime

From DateTime

(DateTime) sub infix:<+>

multi sub infix:<+> (DateTime:DDuration:D --> DateTime:D)
multi sub infix:<+> (Duration:DDateTime:D --> DateTime:D)

Takes a DateTime and increases it by the given Duration, preserving the timezone.

say +;        # OUTPUT: «2016-01-01T00:00:00Z␤» 
say, :3600timezone); # OUTPUT: «2015-01-01T00:00:42+01:00␤»