Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16350

[SERVER] Error with $hour result in an example

    • 1

      In one of the example for $hour (aggregation) documentation, the result is 18.

      { $hour: {
          date: new Date("August 14, 2011Z"),
          timezone: "America/Chicago"
      } }
      

      However the correct result should be 19. Running in the same in old (legacy) mongo shell gives 18. This is because that syntax is wrong for mongosh and the date becomes ISODate("1970-01-01T00:00:00Z")

       

      Discussion on Slack: https://mongodb.slack.com/archives/CC1SW4PA4/p1693242762226949

            Assignee:
            lauren.tran@mongodb.com Lauren Tran
            Reporter:
            yan-cheng.phuah@mongodb.com YC Phuah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              35 weeks, 6 days ago