Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,14 @@ function Date (year, month, day, hour, minute, second, millisecond, timezone) {
case 7:
d = new _Date(year, month, day, hour, minute, second, millisecond); break;
}
if (timezone) {
// set time given timezone relative to the currently set local time
// (changing the internal "time" milliseconds value unless ms specified)
d.setTimezone(timezone, !(argc == 1 && typeof year === 'number'));
} else {
d.setTimezone(exports.currentTimezone);
if (!isNaN(d)) {
if (timezone) {
// set time given timezone relative to the currently set local time
// (changing the internal "time" milliseconds value unless ms specified)
d.setTimezone(timezone, !(argc == 1 && typeof year === 'number'));
} else {
d.setTimezone(exports.currentTimezone);
}
}
return d;
}
Expand Down