Permalink
Browse files

Do not assume dates with no timezone specifier are UTC

Fixes #225
  • Loading branch information...
1 parent 8b9e97f commit b7fd9a5625e4571f24f59b555499317e70ea7f7c Sandro Santilli committed with Dec 7, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/textParsers.js
View
@@ -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) {

0 comments on commit b7fd9a5

Please sign in to comment.