<story><title>datetime.utcnow() is now deprecated</title><url>https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated</url></story><parent_chain><item><author>vegabook</author><text>I suspect a lot of financial data code is going to break. I&amp;#x27;ve worked on a number of codebases where the explicit instructions were &amp;quot;everything is UTC, all the time&amp;quot;, and enforced at the entry edges of the code. Bringing  in timezones was a definite NO for reasons of the unholy mess this would inevitably create:&lt;p&gt;* India has half-hour timezones&lt;p&gt;* Countries change their DST rules all the time.&lt;p&gt;* Conversion between timezones is an utter mess.&lt;p&gt;As Wes McKinney once said about python datetime: &amp;quot;Welcome to Hell&amp;quot;[0]&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;a&amp;#x2F;13753918&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;a&amp;#x2F;13753918&lt;/a&gt;</text></item></parent_chain><comment><author>albert_e</author><text>&amp;gt; India has half-hour timezones&lt;p&gt;Not plural though;&lt;p&gt;The whole of India -- even though it is pretty vast in area -- has a single time-zone country-wide. I am very thankful for this. We already have a lot of other challenges -- including dozens of different languages -- that a single time zone is a relief.&lt;p&gt;But yes -- the +5:30 offset usually makes for a less-than-ideal factor to plan meetings or follow non local event schedules.&lt;p&gt;Did I mention we also hate the Summertime &amp;#x2F; Daylight Saving time adjustments we have to accommodate twice a year when working with western teams -- more adjustment even after most people have already sacrificed on a sane 9-5 schedule to ensure they overlap with EU&amp;#x2F;US teams for daily work meetings. We cant imagine why US that has multiple time-zones already in a single country, and EU whose countries are often smaller than states in India ... need so much adjustment. Why can&amp;#x27;t they, for instance, simply declare that school&amp;#x2F;offices open at 10am instead of 9am for six designated months every year instead of imposing this adjustment on the entire world.</text></comment>
<story><title>datetime.utcnow() is now deprecated</title><url>https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated</url></story><parent_chain><item><author>vegabook</author><text>I suspect a lot of financial data code is going to break. I&amp;#x27;ve worked on a number of codebases where the explicit instructions were &amp;quot;everything is UTC, all the time&amp;quot;, and enforced at the entry edges of the code. Bringing  in timezones was a definite NO for reasons of the unholy mess this would inevitably create:&lt;p&gt;* India has half-hour timezones&lt;p&gt;* Countries change their DST rules all the time.&lt;p&gt;* Conversion between timezones is an utter mess.&lt;p&gt;As Wes McKinney once said about python datetime: &amp;quot;Welcome to Hell&amp;quot;[0]&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;a&amp;#x2F;13753918&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;a&amp;#x2F;13753918&lt;/a&gt;</text></item></parent_chain><comment><author>jagged-chisel</author><text>For sharing between systems and representing dates to humans debugging a system, the following has worked well …&lt;p&gt;Planned local events: future date and time string including local time zone&lt;p&gt;Planned global events: future date and time string in UTC, with UTC timezone&lt;p&gt;Past events: date and time string in UTC with UTC time zone, unless there is a strong case to be made that these should be localized (see “planned local events” above)&lt;p&gt;Strings in the format specified by ISO-8601.&lt;p&gt;Of course, internal representation can be whatever it needs to be for efficiency. For example, maybe your database stores as integer microseconds since an epoch. Fine, but as soon as that leaves the database, ISO-8601 that date.</text></comment>