Skip to content

Commit 01e0fb1

Browse files
committed
added microseconds to date
1 parent b98994a commit 01e0fb1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/query.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,21 @@ var parseDate = function(value) {
321321
var rawValue = parseBits(value, 63, 1);
322322

323323
// discard usecs and shift from 2000 to 1970
324-
return new Date((((sign == 0) ? 1 : -1) * rawValue / 1000) + 946684800000);
324+
var result = new Date((((sign == 0) ? 1 : -1) * rawValue / 1000) + 946684800000);
325+
326+
// add microseconds to the date
327+
result.usec = rawValue % 1000;
328+
result.getMicroSeconds = function() {
329+
return this.usec;
330+
};
331+
result.setMicroSeconds = function(value) {
332+
this.usec = value;
333+
};
334+
result.getUTCMicroSeconds = function() {
335+
return this.usec;
336+
};
337+
338+
return result;
325339
}
326340

327341
var arrayParser = function(value) {

0 commit comments

Comments
 (0)