http://redmine.emweb.be/http://redmine.emweb.be/favicon.ico?16934085252023-03-13T10:48:33ZRedmineWt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=517522023-03-13T10:48:33ZRoel Standaertroel@emweb.be
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>InProgress</i></li><li><strong>Assignee</strong> set to <i>Roel Standaert</i></li><li><strong>Target version</strong> set to <i>4.9.2</i></li></ul><p>Hm, this seems like a Windows-specific bug. I changed the <code>dbo_test1</code> test case to use pre-UNIX epoch dates, and while it's fine on my Linux system, our Windows build is indeed failing.</p>
Wt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=518702023-03-17T13:42:11ZRoel Standaertroel@emweb.be
<ul></ul><p>Turns out every single way that the <code>Sqlite3</code> backend encodes timestamps is wrong in some way, so I'm fixing all of them:</p>
<ol>
<li>when using <code>ISO8601AsText</code> milliseconds are encoded incorrectly for dates before 1970, e.g. December 31, 1969 23:59:59.999 is encoded as <code>1970-01-01T00:00:00.0-1</code> instead of <code>1969-12-31T23:59:59.999</code>.</li>
<li>when using <code>JulianDaysAsReal</code> the decimal (i.e. time of day) part is divided by 1000. It also uses November 24, 4714 BCE at midnight as the reference, instead of noon, so it's off by <code>0.5</code> compared to Sqlite's own <code>julianday(...)</code> function.</li>
<li>when using <code>UnixTimeAsInteger</code> the date part is discarded entirely, and we're saving the time of day as milliseconds instead of as seconds.</li>
</ol>
<p>For <code>JulianDaysAsReal</code> I'm still trying to decide whether we should save <code>WDate(2023, 3, 17)</code> as 2460020.5 or as 2460021.</p>
Wt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=518832023-03-17T15:14:15ZRoel Standaertroel@emweb.be
<ul><li><strong>Status</strong> changed from <i>InProgress</i> to <i>Review</i></li><li><strong>Assignee</strong> deleted (<del><i>Roel Standaert</i></del>)</li><li><strong>Target version</strong> changed from <i>4.9.2</i> to <i>4.10.0</i></li></ul> Wt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=519902023-03-24T09:36:31ZRoel Standaertroel@emweb.be
<ul><li><strong>Status</strong> changed from <i>Review</i> to <i>Implemented @Emweb</i></li><li><strong>Assignee</strong> set to <i>Roel Standaert</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul> Wt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=519932023-03-24T09:52:52ZRoel Standaertroel@emweb.be
<ul><li><strong>Status</strong> changed from <i>Implemented @Emweb</i> to <i>Resolved</i></li></ul> Wt - Bug #11426: sql_value_traits for WDate does not handle dates before year 1970http://redmine.emweb.be/issues/11426?journal_id=540612023-06-05T06:36:48ZMatthias Van Ceulebroeck
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>