trait Units
Trait Units.
Add, subtract and set units.
Methods
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
No description
Returns true if a property can be changed via setter.
No description
Add given units to the current instance.
Subtract given units to the current instance.
No description
Subtract given units or interval to the current instance.
Details
at line38
Units
addRealUnit(string$unit,int$value =1)
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
at line139
subRealUnit($unit,$value =1)
at line151
staticbool
isModifiableUnit(string$unit)
Returns true if a property can be changed via setter.
at line178
Units
rawAdd(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable add() method.
at line197
add($unit,$value =1,$overflow =null)
at line231
Units
addUnit(string$unit,int$value =1,bool|null$overflow =null)
Add given units to the current instance.
at line329
Units
subUnit(string$unit,int$value =1,bool|null$overflow =null)
Subtract given units to the current instance.
at line341
Units
rawSub(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable sub() method.
at line360
sub($unit,$value =1,$overflow =null)
at line396
Units
subtract(string|DateInterval$unit,int$value =1,bool|null$overflow =null)
Subtract given units or interval to the current instance.