-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect publishing times #1447
Comments
Thanks for reporting. I will try to look into it deeper during the weekend. I believe we are currently unfortunately using local time in the database but it can happen that UTC is used when there is But the fact that the date is converted to UTC when displayed is unfortunate as well. |
I just tried this on 483f4ee (no relevant changes since f04dbca) with SQLite and am unable to reproduce it:
I also tried modifying the feed to use Feed source<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>
<![CDATA[Lorem ipsum feed for an interval of 1 minutes with 10 item(s)]]>
</title>
<description>
<![CDATA[This is a constantly updating lorem ipsum feed]]>
</description>
<link>http://example.com/</link>
<generator>RSS for Node</generator>
<lastBuildDate>Sun, 23 Jul 2023 13:47:25 +0200</lastBuildDate>
<pubDate>Sun, 23 Jul 2023 13:47:00 +0200</pubDate>
<copyright>
<![CDATA[Michael Bertolacci, licensed under a Creative Commons Attribution 3.0 Unported License.]]>
</copyright>
<ttl>1</ttl>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:47:00+02:00]]>
</title>
<description>
<![CDATA[Laborum non culpa do qui in cupidatat qui consequat occaecat anim veniam pariatur.]]>
</description>
<link>http://example.com/test/1690112820</link>
<guid isPermaLink="true">http://example.com/test/1690112820</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:47:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:46:00+02:00]]>
</title>
<description>
<![CDATA[Nulla nostrud mollit culpa commodo mollit consequat anim.]]>
</description>
<link>http://example.com/test/1690112760</link>
<guid isPermaLink="true">http://example.com/test/1690112760</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:46:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:45:00+02:00]]>
</title>
<description>
<![CDATA[Consequat non nisi aliquip nisi nisi anim sint occaecat laboris voluptate fugiat duis.]]>
</description>
<link>http://example.com/test/1690112700</link>
<guid isPermaLink="true">http://example.com/test/1690112700</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:45:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:44:00+02:00]]>
</title>
<description>
<![CDATA[Excepteur culpa irure excepteur adipisicing exercitation veniam reprehenderit voluptate mollit eiusmod nostrud cillum amet cillum.]]>
</description>
<link>http://example.com/test/1690112640</link>
<guid isPermaLink="true">http://example.com/test/1690112640</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:44:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:43:00+02:00]]>
</title>
<description>
<![CDATA[Ullamco exercitation duis voluptate tempor.]]>
</description>
<link>http://example.com/test/1690112580</link>
<guid isPermaLink="true">http://example.com/test/1690112580</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:43:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:42:00+02:00]]>
</title>
<description>
<![CDATA[Ea labore labore proident enim aliquip nulla ullamco ullamco dolor fugiat dolore nisi exercitation.]]>
</description>
<link>http://example.com/test/1690112520</link>
<guid isPermaLink="true">http://example.com/test/1690112520</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:42:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:41:00+02:00]]>
</title>
<description>
<![CDATA[Deserunt fugiat amet deserunt nulla.]]>
</description>
<link>http://example.com/test/1690112460</link>
<guid isPermaLink="true">http://example.com/test/1690112460</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:41:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:40:00+02:00]]>
</title>
<description>
<![CDATA[Nulla id proident quis esse aute esse.]]>
</description>
<link>http://example.com/test/1690112400</link>
<guid isPermaLink="true">http://example.com/test/1690112400</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:40:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:39:00+02:00]]>
</title>
<description>
<![CDATA[Sit commodo voluptate ullamco adipisicing laboris.]]>
</description>
<link>http://example.com/test/1690112340</link>
<guid isPermaLink="true">http://example.com/test/1690112340</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:39:00 +0200</pubDate>
</item>
<item>
<title>
<![CDATA[Lorem ipsum 2023-07-23T13:38:00+02:00]]>
</title>
<description>
<![CDATA[Ullamco Lorem aliqua aliquip nisi non.]]>
</description>
<link>http://example.com/test/1690112280</link>
<guid isPermaLink="true">http://example.com/test/1690112280</guid>
<dc:creator>
<![CDATA[John Smith]]>
</dc:creator>
<pubDate>Sun, 23 Jul 2023 13:38:00 +0200</pubDate>
</item>
</channel>
</rss> The relevant client code is: selfoss/client/js/templates/Item.jsx Line 490 in 483f4ee
selfoss/client/js/requests/items.js Line 61 in 483f4ee
selfoss/client/js/requests/items.js Line 5 in 483f4ee
|
Sorry, it seems that I must be looking for the error somewhere in my Firefox profile. The However, if the time is always stored in UTC in the database, then the JSON file should contain it in that format, right? The output of the |
We should have been storing local time in the SQLite database because we have not come up with a migration path yet. But it looks like we accidentally switched to UTC (likely in efae041) so migration is no longer possible (we have no way of knowing which entries were stored in the db before/after the change). But it probably does not matter if older items are few hours off so we can just switch to printing it as UTC. |
I tried the Lorem ipsum feed, and selfoss showed me the latest posts as 2 hours ago. The database stores the correct UTC time, but in the JSON file it is not marked as UTC time, but incorrectly as CEST (+02:00).
|
If I set This way, although selfoss works correctly, the php.ini file does not contain the correct time zone. |
There definitely is a parsing error performed by selfoss related to the timezone. I am using sqlite. I also tested the feed above. |
I did some tests with the two settings. The server's OS time zone is CEST, I just changed the I marked the incorrect values in italic and the correct values in bold, assuming that we want to store the UTC time in the database and expect a value in the JSON file that will be used by selfoss to display the time according to the client's local time zone.
From the results of these tests, it seems to me that selfoss only works consistently with the UTC time zone, with other settings either the database or the JSON file will contain incorrect data. |
Thanks. That is helpful. I opened a PR with a possible fix. Currently untested, will try to test it later in the week. There is quite a few things to check, which is why I have not attempted to fix it until now. |
Thanks! I retested after applying the changes, using the previous method. It seems that if the publication date is not specified in the feed, it still adds incorrect data to the database. But the JSON file now contains UTC dates (but with an incorrect value in the last case).
|
Thanks. I pushed a likely fix. Will still need to test it with MySQL, though. |
Thanks. With the recent fixes, using SQLite now works correctly for me. |
2.20-f04dbca
SQLite
Selfoss shows me the publication time of the items as 4 hours earlier than the real value.
The numeric time zone for both client side and server side is
+0200
.An example:
Fri, 30 Jun 2023 07:54:04 +0200
2023-06-30 05:54:04
2023-06-30T05:54:04+02:00
2023. 06. 30. 3:54:04
As you can see, the time is not displayed in local time (which is what I would expect), but it is also not displayed in UTC time, but an incorrectly calculated time is displayed.
The text was updated successfully, but these errors were encountered: