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

dateToString produces incorrect year/week numbers

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.15
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • Hide

      create an aggregation with a simple projection:

      {
        "FIRST_YEAR_WEEK": { $dateToString: { date: { $dateFromParts: { isoWeekYear: 2020, isoWeek: 1, isoDayOfWeek: 1 } }, format: "%Y-%V" } }
      }
      Show
      create an aggregation with a simple projection: { "FIRST_YEAR_WEEK" : { $dateToString: { date: { $dateFromParts: { isoWeekYear: 2020, isoWeek: 1, isoDayOfWeek: 1 } }, format: "%Y-%V" } } }
    • QE 2024-06-10

      { $dateToString: { date: { $dateFromParts: { isoWeekYear: 2020, isoWeek: 1, isoDayOfWeek: 1 } }, format: "%Y-%V" } }

      this produces `2019-1` where this should be either `2019-52` or `2020-1` 

            Assignee:
            serhii.lysenko@mongodb.com Serhii Lysenko
            Reporter:
            andre.haverdings@ah.nl Andre Haverdings
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: