Skip to content

Commit

Permalink
Return a Duration object for subtraction of two DateTime objects
Browse files Browse the repository at this point in the history
If you subtract two date times return a Duration of the seconds instead of just an Int this should in theory behave exactly the same for everyone involved but just be ready for any additional date functionality added to duration.
  • Loading branch information
MattOates committed Mar 31, 2016
1 parent a700865 commit d080d3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/DateTime/Math.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ multi infix:«-»(DateTime:D $dt, Numeric:D $x) is export {
}

multi infix:<->(DateTime:D $a, DateTime:D $b) is export {
$a.posix - $b.posix;
Duration.new($a.posix - $b.posix);
}


Expand Down

0 comments on commit d080d3d

Please sign in to comment.