Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-960

Dates before epoch not retrieved correctly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.1
    • Affects Version/s: 1.2.4, 1.4.0
    • Component/s: JavaScript, Shell
    • None
    • Environment:
      OS X Snow Leopard, Windows 2003 R2

      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.

            Assignee:
            dwight@mongodb.com Dwight Merriman
            Reporter:
            dsimunic Damir Simunic
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: