Skip to content

Commit

Permalink
Implement a time.currentTimezone property.
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Jun 16, 2011
1 parent 15f6d0e commit a9cfb74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -60,9 +60,11 @@ function tzset(tz) {
}
throw err;
}
exports.currentTimezone = usedTz;
return rtn;
}
exports.tzset = tzset;
exports.currentTimezone = process.env.TZ;

// The "setTimezone" function is the "entry point" for a Date instance.
// It must be called after an instance has been created. After, the 'getSeconds()',
Expand Down
3 changes: 1 addition & 2 deletions test.js
@@ -1,8 +1,7 @@
var assert = require('assert');

var initialTz = process.env.TZ = "UTC";

var time = require('./');
var initialTz = time.currentTimezone;

var d = new time.Date(Date.UTC(2011, 0, 1));

Expand Down

0 comments on commit a9cfb74

Please sign in to comment.