From 3e6d3f3cbe23a0a9be3c86d4b53cf8e1ea5e5f5b Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Wed, 7 Jan 2009 17:10:00 -0500 Subject: [PATCH] support for dates --- bson.py | 16 +++++++++++++++- test/qcheck.py | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/bson.py b/bson.py index 4cbf306a5..f190d2a01 100644 --- a/bson.py +++ b/bson.py @@ -7,6 +7,8 @@ import types import struct import random import re +import datetime +import time from test import test_data, qcheck @@ -186,6 +188,10 @@ def _get_binary(data): def _get_boolean(data): return (data[0] == "\x01", data[1:]) +def _get_date(data): + seconds = float(struct.unpack(" 0: choices.append(gen_mongo_list(depth))