summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2013-11-19 02:31:58 -0800
committerAndreas Rumpf <rumpf_a@web.de>2013-11-19 02:31:58 -0800
commita3163aa2cf3f6b1de8617e34a863b87ec4d8adbe (patch)
tree57845a67209755fdcf89ec01a6f6077c0908ca82
parent220e20e7f218c1472224885f9837faed7a6c8202 (diff)
parentd037aec415c79c8778b1c81d11ff3442e262895a (diff)
downloadNim-a3163aa2cf3f6b1de8617e34a863b87ec4d8adbe.tar.gz
Merge pull request #677 from gradha/pr_fixes_times_calculation
Fixes times.toSeconds to handle hours and minutes correctly.
-rw-r--r--lib/pure/times.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 80a5ad8d3..e967ef683 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -246,7 +246,8 @@ proc toSeconds(a: TTimeInfo, interval: TTimeInterval): float =
     else:
       curMonth.inc()
   result += float(newinterv.days * 24 * 60 * 60)
-  result += float(newinterv.minutes * 60 * 60)
+  result += float(newinterv.hours * 60 * 60)
+  result += float(newinterv.minutes * 60)
   result += float(newinterv.seconds)
   result += newinterv.miliseconds / 1000