Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4694

$dateToString aggregation with timezone outputs invalid ISO8601 string on older servers

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.21.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      DRIVERS-2620:
      The current default behavior of MongoDB's $dateToString aggregation expression is incorrect because it violates ISO 8601. (It tacks on a "Z" to the end of the string by default, which implies that it is in UTC [1], but in actually it's in the timezone of the local server.)

      This ticket proposes a number of routes to change the default behavior of $dateToString to bring it into compliance with ISO 8601.

      [1] https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)

      1. If the query specifies a date format string, this is used.
      2. If no format string is specified, then
      a. If no timezone is specified or the UTC timezone is explicitly specified, the default format will continue to include the 'Z' suffix (yyyy-mm-ddThh:mm:ss.uuuZ).
      b. If a non-UTC timezone is specified, the default format will omit the 'Z' suffix (yyyy-mm-ddThh:mm:ss.uuu).

      Case 2b is the only change from prior behavior.

      This change was delivered in 7.1.0-rc0 and will NOT be backported.

      Show
      DRIVERS-2620: The current default behavior of MongoDB's $dateToString aggregation expression is incorrect because it violates ISO 8601. (It tacks on a "Z" to the end of the string by default, which implies that it is in UTC  [1] , but in actually it's in the timezone of the local server.) This ticket proposes a number of routes to change the default behavior of $dateToString to bring it into compliance with ISO 8601. [1]   https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC ) 1. If the query specifies a date format string, this is used. 2. If no format string is specified, then a. If no timezone is specified or the UTC timezone is explicitly specified, the default format will continue to include the 'Z' suffix (yyyy-mm-ddThh:mm:ss.uuuZ). b. If a non-UTC timezone is specified, the default format will omit the 'Z' suffix (yyyy-mm-ddThh:mm:ss.uuu). Case 2b is the only change from prior behavior. This change was delivered in 7.1.0-rc0 and will NOT be backported.
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      This ticket was split from DRIVERS-2620, please see that ticket for a detailed description.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: