Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

handle daylight savings time

  • Loading branch information...
commit 3a3460647e3859e41c006d759f5f27c8b748861e 1 parent 7fa9682
Dylan Greene authored
10  lib/logging.js
@@ -9,6 +9,16 @@ var clusterCPU = 'CLUSTER_WORKER' in process.env ? Style(Style.GREEN, process.en
9 9
 
10 10
 var TIMEZONE_OFFSET = (240 - (new Date).getTimezoneOffset()) * 60000;
11 11
 
  12
+
  13
+function stdTimezoneOffset() {
  14
+    var fullYear = (new Date()).getFullYear();
  15
+    var jan = new Date(fullYear, 0, 1);
  16
+    var jul = new Date(fullYear, 6, 1);
  17
+    return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()) * 60000;
  18
+}
  19
+
  20
+TIMEZONE_OFFSET = TIMEZONE_OFFSET < stdTimezoneOffset() ? TIMEZONE_OFFSET + 3600000 : TIMEZONE_OFFSET;
  21
+
12 22
 function writeLog(d) {
13 23
 
14 24
     var res = process.stdout.write(d + '\n');
2  package.json
... ...
@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name": "logging",
3  
-    "version": "2.0.12",
  3
+    "version": "2.0.13",
4 4
     "description": "Super sexy color console logging with cluster support.",
5 5
     "homepage": "http://github.com/dylang/logging",
6 6
     "author": "Dylan Greene <dylang@gmail.com>",

0 notes on commit 3a34606

Please sign in to comment.
Something went wrong with that request. Please try again.