mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
added microseconds to date
This commit is contained in:
parent
b98994ae39
commit
01e0fb1b92
16
lib/query.js
16
lib/query.js
@ -321,7 +321,21 @@ var parseDate = function(value) {
|
||||
var rawValue = parseBits(value, 63, 1);
|
||||
|
||||
// discard usecs and shift from 2000 to 1970
|
||||
return new Date((((sign == 0) ? 1 : -1) * rawValue / 1000) + 946684800000);
|
||||
var result = new Date((((sign == 0) ? 1 : -1) * rawValue / 1000) + 946684800000);
|
||||
|
||||
// add microseconds to the date
|
||||
result.usec = rawValue % 1000;
|
||||
result.getMicroSeconds = function() {
|
||||
return this.usec;
|
||||
};
|
||||
result.setMicroSeconds = function(value) {
|
||||
this.usec = value;
|
||||
};
|
||||
result.getUTCMicroSeconds = function() {
|
||||
return this.usec;
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
var arrayParser = function(value) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user