batmanjs/batman — pull request #993 by davidcornu (2014-03-06 01:00:37+00:00)
Title: Use the correct offset for Batman.Encoders.railsDate

When parsing a timestamp without a timezone indicator or offset, `Batman.Encoders.railsDate` uses `defaultTimezoneOffset` which is obtained from `(new Date).getTimezoneOffset()`.

While this may be the correct value for today, it is an invalid assumption for older timestamps. For instance:

Start a browser in "Australia/Tasmania"

```
$ TZ="Australia/Tasmania" /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
```

and run the following

```javascript
console.log((new Date(2013, 2, 5)).getTimezoneOffset());
// => -660
console.log((new Date(1988, 7, 8)).getTimezoneOffset());
// => -600
```

The solution is call `getTimezoneOffset()` on the correct local time instead of on `new Date`.

cc @byroot, @ibawt & @tjoyal