<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:14:34 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DOCS-16090] [SERVER] $dateToString outputs invalid ISO8601 string</title>
                <link>https://jira.mongodb.org/browse/DOCS-16090</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;ORIGINAL TITLE: Investigate changes in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-76696&quot; title=&quot;$dateToString aggregation with timezone outputs invalid ISO8601 string&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-76696&quot;&gt;&lt;del&gt;SERVER-76696&lt;/del&gt;&lt;/a&gt;: $dateToString aggregation with timezone outputs invalid ISO8601 string&lt;/p&gt;


  &lt;div class=&quot;panel&quot; style=&quot;background-color: #c2d2c2;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;background-color: #239eb0;&quot;&gt;&lt;b&gt;Original Downstream Change Summary&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;    The current default behavior of MongoDB&apos;s $dateToString aggregation expression is incorrect because it violates ISO 8601. (It tacks on a &quot;Z&quot; to the end of the string by default, which implies that it is in UTC &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, but in actually it&apos;s in the timezone of the local server.)&lt;/p&gt;

&lt;p&gt;This ticket proposes a number of routes to change the default behavior of $dateToString to bring it into compliance with ISO 8601.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC&lt;/a&gt;)&lt;/p&gt;
&lt;h2&gt;&lt;a name=&quot;DescriptionofLinkedTicket&quot;&gt;&lt;/a&gt;Description of Linked Ticket&lt;/h2&gt;
&lt;p&gt;    When using the &lt;tt&gt;$dateToString&lt;/tt&gt; aggregation operator on an ISODate value, specifying a timezone but not a format string, an invalid/inaccurate ISO8601 date string is returned. &lt;/p&gt;

&lt;p&gt;Specifically: &lt;tt&gt;2023-04-26T12:06:17.194Z&lt;/tt&gt; when using something like:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.collection.aggregate([{ &quot;$addFields&quot;: {&quot;txDateString&quot;: { &quot;$dateToString&quot;: {date: &quot;$transactionDateTS&quot;, timezone: &quot;America/New_York&quot;} } }} ])`&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;The root issue is that the &quot;Z&quot; &lt;b&gt;categorically implies&lt;/b&gt; a timezone of UTC (+00:00)... But, in this case, that&apos;s absolutely incorrect and, technically, makes it an invalid ISO8601 date string. (I suppose one could argue that it&apos;s &lt;b&gt;syntatically&lt;/b&gt; valid - but it&apos;s certainly misleading and could result in major issues if another program were to parse the date string as it would interpret the time as &quot;Zulu&quot;/UTC because of the &quot;Z&quot;.) The inclusion of the &quot;Z&quot; when &lt;b&gt;explicitly specifying&lt;/b&gt; a timezone is certainly unexpected...  &lt;/p&gt;

&lt;p&gt;At a &lt;b&gt;minimum&lt;/b&gt;, when a format string is unspecified and a date/time in UTC is converted to another time zone, the &quot;Z&quot; should be left off. Ideally, the UTC offset (obtained from the timezone conversion) should be included as per ISO8601 &amp;#8211; i.e. in this case, &lt;tt&gt;2023-04-26T12:06:17.194-04:00&lt;/tt&gt; (at the time of this writing, &lt;tt&gt;America/New_York&lt;/tt&gt; is on Eastern Daylight Time (EDT) which is UTC-04:00.) &lt;/p&gt;

&lt;p&gt;Related issues appear to include: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33173&quot; title=&quot;Make &amp;quot;format&amp;quot; parameter optional for $dateToString&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33173&quot;&gt;&lt;del&gt;SERVER-33173&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28610&quot; title=&quot;Add time zone support, and %z and %Z arguments to the $dateToString operator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28610&quot;&gt;&lt;del&gt;SERVER-28610&lt;/del&gt;&lt;/a&gt; &lt;/p&gt;
</description>
                <environment></environment>
        <key id="2330360">DOCS-16090</key>
            <summary>[SERVER] $dateToString outputs invalid ISO8601 string</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="nick.villahermosa@mongodb.com">Nick Villahermosa</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                            <label>query</label>
                            <label>release</label>
                    </labels>
                <created>Tue, 2 May 2023 19:34:38 +0000</created>
                <updated>Mon, 13 Nov 2023 17:25:27 +0000</updated>
                            <resolved>Wed, 13 Sep 2023 14:19:43 +0000</resolved>
                                    <version>6.0.3</version>
                                    <fixVersion>7.1.0-rc0</fixVersion>
                    <fixVersion>Server_Docs_20231030</fixVersion>
                    <fixVersion>Server_Docs_20231106</fixVersion>
                    <fixVersion>Server_Docs_20231105</fixVersion>
                    <fixVersion>Server_Docs_20231113</fixVersion>
                                    <component>manual</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5701039" author="JIRAUSER1270643" created="Wed, 13 Sep 2023 14:20:01 +0000"  >&lt;p&gt;No backports, as code change isn&apos;t backported&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                        <issuelink>
            <issuekey id="2327954">SERVER-76696</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 2 May 2023 20:28:08 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        21 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14876" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Docs Reviewer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>jeffrey.allen@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>The current default behavior of MongoDB&amp;#39;s $dateToString aggregation expression is incorrect because it violates ISO 8601. (It tacks on a &amp;quot;Z&amp;quot; to the end of the string by default, which implies that it is in UTC [1], but in actually it&amp;#39;s in the timezone of the local server.)&lt;br/&gt;
&lt;br/&gt;
This ticket proposes a number of routes to change the default behavior of $dateToString to bring it into compliance with ISO 8601.&lt;br/&gt;
&lt;br/&gt;
[1] &lt;a href=&quot;https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)&quot;&gt;https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
1. If the query specifies a date format string, this is used.&lt;br/&gt;
2. If no format string is specified, then&lt;br/&gt;
&amp;nbsp;&amp;nbsp;a. If no timezone is specified or the UTC timezone is explicitly specified, the default format will continue to include the &amp;#39;Z&amp;#39; suffix (yyyy-mm-ddThh:mm:ss.uuuZ).&lt;br/&gt;
&amp;nbsp;&amp;nbsp;b. If a non-UTC timezone is specified, the default format will omit the &amp;#39;Z&amp;#39; suffix (yyyy-mm-ddThh:mm:ss.uuu).&lt;br/&gt;
&lt;br/&gt;
Case 2b is the only change from prior behavior.&lt;br/&gt;
&lt;br/&gt;
This change was delivered in 7.1.0-rc0 and will NOT be backported.&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&lt;br/&gt;
</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_14873" key="com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker">
                        <customfieldname>External Reviewer</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[kevin.cherkauer@mongodb.com]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            21 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-pm</customfieldvalue>
            <customfieldvalue>nick.villahermosa@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i27ebz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1poxs:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i270hb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                </customfields>
    </item>
</channel>
</rss>