diff options
author | Federico Ceratto <federico.ceratto@suse.com> | 2017-07-29 11:42:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-29 11:42:03 +0100 |
commit | a038c62befcf5150f7e4cffe176e49c8ce85d467 (patch) | |
tree | 4b1339449dd35f8cbee397f7aa4c87b9df519270 /lib/pure | |
parent | c3d5464e6fa3c5f902f160a5d9091d914398c376 (diff) | |
download | Nim-a038c62befcf5150f7e4cffe176e49c8ce85d467.tar.gz |
Add TimeInterval reversing docstring
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/times.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim index 1bda94d14..c2809acf7 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -301,6 +301,11 @@ proc `+`*(ti1, ti2: TimeInterval): TimeInterval = result.years = carryO + ti1.years + ti2.years proc `-`*(ti: TimeInterval): TimeInterval = + ## Reverses a time interval + ## .. code-block:: nim + ## + ## let day = -initInterval(hours=24) + ## echo day # -> (milliseconds: 0, seconds: 0, minutes: 0, hours: 0, days: -1, months: 0, years: 0) result = TimeInterval( milliseconds: -ti.milliseconds, seconds: -ti.seconds, |