[SERVER-960] Dates before epoch not retrieved correctly Created: 05/Apr/10  Updated: 12/Jul/16  Resolved: 06/Jul/11

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 1.2.4, 1.4.0
Fix Version/s: 1.9.1

Type: Bug Priority: Major - P3
Reporter: Damir Simunic Assignee: Dwight Merriman
Resolution: Done Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X Snow Leopard, Windows 2003 R2


Issue Links:
Depends
depends on SERVER-405 dates before epoch sorting Closed
Related
related to SERVER-14891 Shell will create invalid dates and t... Backlog
Participants:

 Description   

Mongo fails to round-trip the date before epoch when inserted via shell:

> t = db.date1;
> t.drop();
> var d = new Date(-1);
> t.save(

{a:1, d:d}

);
> assert.eq(d, t.findOne().d, "Should be equal");
assert: ["Wed Dec 31 1969 23:59:59 GMT+0000 (BST)"] != ["Tue Jan -2147483647 584556020 15:25:52 GMT+0100 (BST)"] are not equal : Should be equal

Reproducible on OS X version 1.2.4 32/64-bit, 1.4.0/64, 1.4.1-pre/64, 1.5.0-pre and on Windows 1.4.0 32-bit.



 Comments   
Comment by auto [ 09/Aug/11 ]

Author:

{u'login': u'TonyGen', u'name': u'Tony Hannan', u'email': u'tony@10gen.com'}

Message: new jstests/date3.js for SERVER-405 & SERVER-960
Branch: master
https://github.com/mongodb/mongo/commit/ad2f56a651b0b25f7a63ca4f533bdbc48b8c6ef0

Comment by Mikael Nousiainen [ 20/Oct/10 ]

I can confirm that this problem exists also in version 1.6.2 (Linux 64-bit build).

Generated at Thu Feb 08 02:55:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.