[tor-commits] [atlas/master] Properly convert time to UTC before doing calculation

art at torproject.org art at torproject.org
Wed Apr 4 01:13:05 UTC 2012


commit 1d1d15fed03c226c7482e0310a23e28706edf9d2
Author: Arturo Filastò <hellais at gmail.com>
Date:   Tue Apr 3 18:13:26 2012 -0700

    Properly convert time to UTC before doing calculation
    Fixing #5318
---
 js/models/relay.js |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/js/models/relay.js b/js/models/relay.js
index ccefeec..8e9583d 100644
--- a/js/models/relay.js
+++ b/js/models/relay.js
@@ -60,6 +60,7 @@ define([
             var utct = t[1].split(":");
             var d = new Date(utcd[0], utcd[1]-1, utcd[2], utct[0], utct[1], utct[2]);
             var now = new Date();
+            now = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(),  now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
             var diff = now-d;
             var secs = Math.round(diff/1000);
             var mins = Math.floor(secs/60);



More information about the tor-commits mailing list