Skip to content

Commit

Permalink
Do not assume dates with no timezone specifier are UTC
Browse files Browse the repository at this point in the history
Fixes #225
  • Loading branch information
Sandro Santilli authored and brianc committed Dec 11, 2012
1 parent 8b9e97f commit b7fd9a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/textParsers.js
Expand Up @@ -47,12 +47,14 @@ var parseDate = function(isoDate) {
default:
throw new Error("Unidentifed tZone part " + type);
}
}

var utcOffset = Date.UTC(year, month, day, hour, min, seconds, mili);
var utcOffset = Date.UTC(year, month, day, hour, min, seconds, mili);
return new Date(utcOffset - (tzAdjust * 60* 1000));
}
else {
return new Date(year, month, day, hour, min, seconds, mili);
}

var date = new Date(utcOffset - (tzAdjust * 60* 1000));
return date;
};

var parseBool = function(val) {
Expand Down

0 comments on commit b7fd9a5

Please sign in to comment.