<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:40 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>[CSHARP-729] Serializing a class with two dates to BsonDocument creates wrong value in one date</title>
                <link>https://jira.mongodb.org/browse/CSHARP-729</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The following code will convert both dates to UTC, but with the same hour!  This output is produced:&lt;/p&gt;

&lt;p&gt;2:52:26 AM (Notice the hour)&lt;br/&gt;
3:05:26 AM (Notice the hour)&lt;br/&gt;
2013-03-10T08:52:26Z (shows wrong hour.  Should be 7, not 8)&lt;br/&gt;
2013-03-10T08:05:26Z (this is correct) &lt;/p&gt;

&lt;p&gt; public class TestDateSerialize&lt;br/&gt;
        {&lt;br/&gt;
            public DateTime EntryDtTm &lt;/p&gt;
{ get; set; }&lt;br/&gt;
            public DateTime ExitDtTm { get; set; }
&lt;p&gt;        }&lt;/p&gt;


&lt;p&gt;        public void testSerializeDateTime()&lt;/p&gt;
        {
            var obj = new TestDateSerialize();
            obj.EntryDtTm = Convert.ToDateTime(&quot;3/10/2013 02:52:26&quot;);
            obj.ExitDtTm = Convert.ToDateTime(&quot;3/10/2013 03:05:26&quot;);

            var doc = obj.ToBsonDocument();

            Console.WriteLine(obj.EntryDtTm.ToLongTimeString());
            Console.WriteLine(obj.ExitDtTm.ToLongTimeString());

            Console.WriteLine(doc[&quot;EntryDtTm&quot;].AsBsonValue);
            Console.WriteLine(doc[&quot;ExitDtTm&quot;].AsBsonValue);

        }
</description>
                <environment>Windows 7 Professional 64-bit.  Visual Studio 2010 SP1.  .Net Framework 4.0.   Central Time Zone.</environment>
        <key id="72214">CSHARP-729</key>
            <summary>Serializing a class with two dates to BsonDocument creates wrong value in one date</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="paulbrower">Paul Brower</reporter>
                        <labels>
                            <label>BsonDocument</label>
                            <label>DateTime</label>
                            <label>Serialization</label>
                    </labels>
                <created>Thu, 18 Apr 2013 12:06:37 +0000</created>
                <updated>Thu, 20 Mar 2014 16:39:10 +0000</updated>
                            <resolved>Thu, 18 Apr 2013 14:54:09 +0000</resolved>
                                    <version>1.8.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="316301" author="rstam" created="Thu, 18 Apr 2013 14:53:45 +0000"  >&lt;p&gt;Glad to help!&lt;/p&gt;</comment>
                            <comment id="316250" author="paulbrower" created="Thu, 18 Apr 2013 13:56:24 +0000"  >&lt;p&gt;My colleague and I are amazed at how quickly you determined and responded to this issue!  Thanks.  We&apos;ll figure out how to deal with this on our end.  Please close this ticket.&lt;/p&gt;</comment>
                            <comment id="316191" author="rstam" created="Thu, 18 Apr 2013 12:25:12 +0000"  >&lt;p&gt;In 2013 Daylight Saving Time started at 2am on March 10. At 2am clocks were set forward one hour, so the next minute after 1:59am is 3:00am.&lt;/p&gt;

&lt;p&gt;Because the clock was set forward one hour, times from 2:00am to 2:59am are not valid.&lt;/p&gt;

&lt;p&gt;The first test time you used, &quot;3/10/2013 02:52:26&quot;, falls into this invalid range. .NET doesn&apos;t throw any exceptions when you use these invalid times (and in any case, whether they are valid or not depends on what time zone you are in and whether you observe Daylight Saving Time or not). What .NET does with these &quot;invalid&quot; values is assume that they actually correspond to one hour later. So when .NET sees the invalid 02:52:26 it assumes you really meant 03:52:26.&lt;/p&gt;

&lt;p&gt;I don&apos;t think this is a diver bug or anything we need to do anything about. It is really just an idiosyncrasy of how .NET interprets time values that are not valid due to Daylight Saving Time.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrnch3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>49971</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>