From 01e0fb1b922c51206f621f9fd3def48c7b8beafc Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 28 Jan 2011 18:16:12 +0100 Subject: [PATCH] added microseconds to date --- lib/query.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/query.js b/lib/query.js index 12a7108e..592c6d44 100644 --- a/lib/query.js +++ b/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) {