Skip to content

Commit

Permalink
check that the tz variable is set in setTimezone()
Browse files Browse the repository at this point in the history
Attempting to fix #16.
  • Loading branch information
TooTallNate committed Apr 24, 2012
1 parent 92ce475 commit d9e605f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function setTimezone (timezone, relative) {
// tzset() to change the current timezone of the process. // tzset() to change the current timezone of the process.
var oldTz = exports.currentTimezone var oldTz = exports.currentTimezone
, tz = exports._currentZoneinfo; , tz = exports._currentZoneinfo;
if (oldTz != timezone) { if (!tz || oldTz !== timezone) {
debug('current timezone is not "%s", calling tzset()', timezone); debug('current timezone is not "%s", calling tzset()', timezone);
tz = exports.tzset(timezone); tz = exports.tzset(timezone);
} }
Expand Down

1 comment on commit d9e605f

@voodootikigod
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes for me! thanks.

Please sign in to comment.