<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:44:20 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>[COMPASS-6785] Investigate changes in SERVER-76696: $dateToString aggregation with timezone outputs invalid ISO8601 string</title>
                <link>https://jira.mongodb.org/browse/COMPASS-6785</link>
                <project id="13182" key="COMPASS">Compass </project>
                    <description>    &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="2330362">COMPASS-6785</key>
            <summary>Investigate changes in SERVER-76696: $dateToString aggregation with timezone outputs invalid ISO8601 string</summary>
                <type id="10501" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Investigation</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 May 2023 19:34:42 +0000</created>
                <updated>Thu, 22 Jun 2023 15:57:16 +0000</updated>
                            <resolved>Tue, 9 May 2023 15:41:10 +0000</resolved>
                                                    <fixVersion>No version</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5518697" author="dbeng-pm-bot" created="Thu, 22 Jun 2023 15:57:16 +0000"  >&lt;p&gt;&lt;em&gt;Fix Version updated for upstream &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;:&lt;/em&gt; &lt;br/&gt;
7.1.0-rc0&lt;/p&gt;</comment>
                            <comment id="5411796" author="rhys.howell" created="Tue, 9 May 2023 15:41:10 +0000"  >&lt;p&gt;No devtools impact, we aren&apos;t doing anything with the dates or the `$dateToString` stage directly.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 9 May 2023 15:41:10 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        32 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-76696'>SERVER-76696</a></s>]]></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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            32 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-pm</customfieldvalue>
            <customfieldvalue>dbeng-pm-bot</customfieldvalue>
            <customfieldvalue>rhys.howell@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i27ecf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1poy8:</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|i270hr:</customfieldvalue>

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