Created
July 20, 2015 09:03
-
-
Save nDmitry/6d7fa5c3e16141ee0b7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var types = require('pg').types; | |
var TIMESTAMP_WOTZ = 1114; // timestamp without time zone | |
var PARSER = types.getTypeParser(TIMESTAMP_WOTZ); | |
types.setTypeParser(TIMESTAMP_WOTZ, function(val) { | |
var result = PARSER(val); | |
return val === null ? null : new Date(result - new Date().getTimezoneOffset() * 60 * 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment