make sure we're using utc

This commit is contained in:
Mike Dirolf 2009-02-25 17:42:03 -05:00
parent f9610dc74d
commit 9edafa2167
5 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ db.pymongo.insert({"x": 20, "y": 100})
db.pymongo.insert({"greeting": True, "hello": u"world"})
# floats and dates.
db.pymongo.insert({"name": u"mike", "account balance": 0.01, "time": datetime.datetime.now()})
db.pymongo.insert({"name": u"mike", "account balance": 0.01, "time": datetime.datetime.utcnow()})
# The find_one method returns a single document, or None.
doc = db.pymongo.find_one({"x": 20})

View File

@ -88,7 +88,7 @@ class GridFile(object):
if mode == "r":
raise IOError("No such file: %r" % file_spec)
file_spec["length"] = 0
file_spec["uploadDate"] = datetime.datetime.now()
file_spec["uploadDate"] = datetime.datetime.utcnow()
file_spec.setdefault("chunkSize", 256000)
self.__id = self.__collection.files.insert(file_spec)["_id"]

View File

@ -175,7 +175,7 @@ class TestGridFile(unittest.TestCase):
self.assertRaises(AttributeError, set_chunk_size)
def set_upload_date():
a.upload_date = datetime.datetime.now()
a.upload_date = datetime.datetime.utcnow()
self.assertRaises(AttributeError, set_upload_date)
a.aliases = ["hello", "world"]

View File

@ -36,7 +36,7 @@ medium = {"integer": 5,
# this is similar to the benchmark data posted to the user list
large = {"base_url": "http://www.example.com/test-me",
"total_word_count": 6743,
"access_time": datetime.datetime.now(),
"access_time": datetime.datetime.utcnow(),
"meta_tags": {"description": "i am a long description string",
"author": "Holly Man",
"dynamically_created_meta_tag": "who know\n what"

View File

@ -123,7 +123,7 @@ def remove(db, out):
def stress1(db, out):
for i in range(50000):
db.stress1.save({"name": "asdf" + str(i),
"date": datetime.datetime.now(),
"date": datetime.datetime.utcnow(),
"id": i,
"blah": "lksjhasoh1298a1shasoidiohaskjasiouashoasasiugoas" +
"lksjhasoh1298a1shasoidiohaskjasiouashoasasiugoas" +