Boost C++ Libraries: Ticket #7525: Wrong clock_string<system_clock>::since() on Windows https://svn.boost.org/trac10/ticket/7525 <p> clock_string&lt;system_clock&gt;::since() should return "since Jan 1, 1601" on Windows platform because FILETIME struct used in implementation is counted since specified date: <a class="ext-link" href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx"><span class="icon">​</span>http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7525 Trac 1.4.3 viboes Sun, 21 Oct 2012 09:18:23 GMT status changed https://svn.boost.org/trac10/ticket/7525#comment:1 https://svn.boost.org/trac10/ticket/7525#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Thanks for catching this. I will fix it as soon as possible. </p> Ticket viboes Mon, 22 Oct 2012 17:22:34 GMT <link>https://svn.boost.org/trac10/ticket/7525#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:2</guid> <description> <p> Hi, </p> <p> I believed that just changing the clock_string&lt;system_clock&gt;::since() for windows will be enough. However, if we want to be able to read a time_point output generated by a Windows machine from a Linux machine the parser needs to be aware of the differences. </p> <p> An alternative is to use always "since Jan 1, 1900" and adapt the operators &lt;&lt; and &gt;&gt; only on Windows machines. What do you think? </p> </description> <category>Ticket</category> </item> <item> <author>oliora@…</author> <pubDate>Mon, 22 Oct 2012 21:19:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:3</guid> <description> <p> I think this is not an option because user will be confused why value of time_since_epoch() is different from printed value. Let's keep printed data the same as stored. I don't see the real problem in epoch difference between Window and Linux. Standard tells nothing about epoch concrete value or its exchangeability. And user always can convert time_point to time_t or user's own format to send data outside. But if you still want to make epoch the same on Windows and Linux, add conversion to now() function (to have time_since_epoch() the same on both platforms) but not to operator &lt;&lt; and &gt;&gt;. Thank you </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 18 Jan 2013 21:27:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7525#comment:4 https://svn.boost.org/trac10/ticket/7525#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I have decided to don't fix as after the patch in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7868" title="#7868: Bugs: chrono_io parses time incorrectly (1.53 and 1.52) (closed: fixed)">#7868</a> version 2 for chrono/io works. Version 2 outputs a date instead of the time "since Jan 1, 1900" which solves the issue. Version 2 will be the default since version Boost 1.55. </p> Ticket viboes Sat, 19 Jan 2013 22:06:46 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/7525#comment:5 https://svn.boost.org/trac10/ticket/7525#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> <p> Thinking a little bit more on that I don't see why clock_string&lt;system_clock&gt;::since() should return "since Jan 1, 1601" as e.g. std::time_t represents a date after midnight, January 1, 1970, UTC. </p> <p> Anyway, I have reopened it as the output is not correct. </p> Ticket oliora@… Sun, 20 Jan 2013 12:01:08 GMT <link>https://svn.boost.org/trac10/ticket/7525#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:6</guid> <description> <p> Because time_t is a number of seconds since January 1, 1970, UTC. But system_clock on Windows is a number of ticks since Jan 1, 1601. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 20 Jan 2013 12:56:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7525#comment:6" title="Comment 6">oliora@…</a>: </p> <blockquote class="citation"> <p> Because time_t is a number of seconds since January 1, 1970, UTC. But system_clock on Windows is a number of ticks since Jan 1, 1601. </p> </blockquote> <p> I agree. I will fix the system clock so that count() give the periods "since January 1, 1970, UTC". </p> </description> <category>Ticket</category> </item> <item> <author>oliora@…</author> <pubDate>Sun, 20 Jan 2013 13:41:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:8</guid> <description> <p> Are you going to fix number of ticks that time_point&lt;system_clock&gt; keeps internally? I.e. convert ('since' from system specific time) to ('since' January 1, 1970) on every platform? If so, it looks like good solution (for me at least). </p> </description> <category>Ticket</category> </item> <item> <author>oliora@…</author> <pubDate>Sun, 20 Jan 2013 13:42:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:9</guid> <description> <p> Are you going to do this conversion only once, inside system_clock::now() ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 20 Jan 2013 16:19:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:10</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7525#comment:9" title="Comment 9">oliora@…</a>: </p> <blockquote class="citation"> <p> Are you going to do this conversion only once, inside system_clock::now() ? </p> </blockquote> <p> Yes. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 20 Jan 2013 16:19:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7525#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7525#comment:11</guid> <description> <p> There is an issue with gmtime on Windows when the time_t parameter is &lt; 0. I have added an internal implementation for this function in Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/82562" title="Chrono: Added internal_gmtime">[82562]</a>. </p> <p> Then I have made that system clock counts periods "since January 1, 1970, UTC" And activated the use of the internal gmtime function on windows in Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/82563" title="Chrono: make use of internal_gmtime on windows and make system_clock ...">[82563]</a>. </p> <p> This should fix the issue for both Boost.Chrono versions, 1 or 2. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 27 Jan 2013 12:35:24 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/7525#comment:12 https://svn.boost.org/trac10/ticket/7525#comment:12 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.53.0</span> </li> </ul> <p> Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/82612" title="Chrono: merge [82562][82663].">[82612]</a> Chrono: merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/82562" title="Chrono: Added internal_gmtime">[82562]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/82663" title="Chrono: fix #7940">[82663]</a>. </p> Ticket