Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4570

$date field being saved incorrectly for old dates

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • No version
    • 1.24.6
    • Compass
    • None
    • Not Needed

    Description

      Problem Description

      When inserting data using the $date operator, if the date is bellow a certain threshold there are some divergences in the value recorded.

      Steps to Reproduce

      Open Atlas

      Create a document with date "1400-01-01 00:00:00"

       

      { "valid_date": { "$date": "1400-01-01T00:00:00" }}

       

      Compass will save the document with the following values. Please see  the minutes added.

       

      { "_id": { "$oid": "5ffdf6ca652224f556bc2ecf" },
      "valid_date": { "$date": "1400-01-01T05:17:32.000Z" } }
      

       

      Expected Results

      We expect the results to be a precise minute instead (still respecting the timezone in the test case -5GMT)

      Actual Results

      It is adding 17 minutes 32 seconds to the date

      Additional Notes

      mongo shell keep the same date, it might be driver related.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adamo.tonete@mongodb.com Adamo Tonete (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: