Page 1 of 2

Article Time ahead 1 Hour

Posted: 06 Apr 2013, 00:33
by pinion
My articles have a time on them that is an hour ahead of my actual time. I've selected the right time zone in the interface and verified that my server time is correct, both locally and the UTC time matches. I'm not sure what I could be doing wrong, perhaps it's just the way some of the people are posting their feeds. Has anyone else seen this? Hopefully it's just something I've missed somewhere.

Re: Article Time ahead 1 Hour

Posted: 06 Apr 2013, 00:52
by pinion
As an example this post shows a time of 3:30 on their website but 4:30 in my feed but it physically showed up sometime before 4 in my feed: http://www.tuaw.com/2013/04/05/daily-ip ... -microrpg/

So while it could be a problem with the timestamp on the feed Simplepie is parsing I think it's more likely something I've set wrong somewhere (or didn't set). But other than the timezone in preferences and the time on the server I don't know what else to check.

Re: Article Time ahead 1 Hour

Posted: 06 Apr 2013, 01:19
by phz
Have you set the correct timezone in the `php.ini` file for your PHP installation? In the category `[Date]`, variable `date.timezone`. See http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone.

That is is one hour that differs and that you noticed it just now might very well be related to a DST error, since at least the EU entered DST last Sunday.

Re: Article Time ahead 1 Hour

Posted: 06 Apr 2013, 12:16
by smeerbartje
Same here; I have set the timezone in the php.ini file. I also have set the timezone in the tt-rss preferences. Now when I look at the update2.php logging, I see that the timestamps are two hours late. In the example below, actual time was 10:14. What could be wrong?

Code: Select all

[08:14:51/13011] Removed 0 files.
[08:14:51/13011] Expiring cache/export
[08:14:51/13011] Removed 0 files.
[08:14:51/13011] Removing old lock files...
[08:14:51/13011] Removed 0 files.
[08:14:51/13011] Base feed: http://feeds.feedburner.com/tweakers/nieuws
[08:14:51/13011]  => 2013-04-06 07:44:45, 27

Re: Article Time ahead 1 Hour

Posted: 06 Apr 2013, 12:21
by fox
Daemon logs in UTC.

Re: Article Time ahead 1 Hour

Posted: 06 Apr 2013, 12:23
by smeerbartje
Thanks; this could be an improvement for future versions.

Re: Article Time ahead 1 Hour

Posted: 08 Apr 2013, 02:31
by pinion
My php.ini in /etc has the right timezone and my system has the right timezone. The daemon is logging the proper UTC time and my user account has the correct timezone set as well. But I'm still an hour ahead on the article times and I have no idea why. Maybe I'll switch everything to New York since I'm on Eastern time anyway and see if that makes a difference. It's been doing this for about a month ever since I first installed ttrss. Anyone have any other ideas what to check on?

Re: Article Time ahead 1 Hour

Posted: 08 Apr 2013, 02:45
by AngryChris
It sounds like your timezone is "wrong" insomuch as it sounds like articles are being displayed in Eastern Standard Time when you're now in Eastern Daylight time (with EST being one hour ahead of EDT). The switch this year was on March 10th which is "about a month ago" (today being April 7th). How you correct it, I don't know, but this strikes me as being the root of your issue.

Re: Article Time ahead 1 Hour

Posted: 08 Apr 2013, 09:45
by phz
AngryChris wrote:It sounds like your timezone is "wrong" insomuch as it sounds like articles are being displayed in Eastern Standard Time when you're now in Eastern Daylight time (with EST being one hour ahead of EDT). The switch this year was on March 10th which is "about a month ago" (today being April 7th). How you correct it, I don't know, but this strikes me as being the root of your issue.

Exactamundo. "Correct" timezone concerns DST issues as much as UTC offset (unless one wants to manually change things twice a year). E.g. UTC+1 and CET might seem equivalent (and I've seen several programming errors in this respect in different places), but aren't, since the latter takes DST into account and thus is correct all year round.

Check `php.ini` and make sure the timezone is really correctly specified, would be my first guess.

Re: Article Time ahead 1 Hour

Posted: 08 Apr 2013, 16:19
by dang
And make sure you're not using one of the Eastern zone files (such as parts of Indiana) that don't use DST.

Re: Article Time ahead 1 Hour

Posted: 08 Apr 2013, 19:14
by pinion
I changed the timezone on the admin account to America/New_York this morning. I also did this in my user account which I changed a few days ago and it didn't make a difference. However, changing the admin account time zone seems to make all the articles show up at the appropriate times in my user account. It doesn't seem like the admin time zone would have any bearing at all on the user timezones. So I have no idea why it started working properly after I changed it.

Re: Article Time ahead 1 Hour

Posted: 26 Apr 2013, 01:33
by NemesisRE
Hi,
I'm new to TTRSS but I love it! Thanks for your hard work!

I have the wrong time too but only on the folder view in the feed view is the right time.

Some Information:
TTRSS Version: trunk
Server: Ubuntu 12.10 - Apache2 - PHP5.4.6
Server Timezone: Europe/Berlin


Hope this helps :)

Kind regards
Steven

Re: Article Time ahead 1 Hour

Posted: 26 Apr 2013, 08:27
by fox
Now that I think about it there's nothing in tt-rss for DST support. Maybe a separate checkbox for DST is required or detecting based on http client-date or something.

Edit: http://www.thisprogrammingthing.com/201 ... e-website/ looks like php 5.3 has support for timezone transitions, but I don't think those are used automatically.

Re: Article Time ahead 1 Hour

Posted: 26 Apr 2013, 08:45
by fox
NemesisRE wrote:I have the wrong time too but only on the folder view in the feed view is the right time.


Yeah, I'm also seeing this. For some reason in some situation when a cached timezone object is first created it gives the non-DST offset, but in other cases it works properly. No idea why.

Edit: this is quite strange. Looks like timezone getOffset() is confused (?) by some oldish dates (like 1970-01-01) and doesn't return offset with DST (or maybe there was no DST in 1970s? I dunno.) and with the way it was done previously the offset got stored and screwed all subsequent date calculations. I have changed it to save the timezone object so that offset is calculated correctly for each specified timestamp, which seems to fix stuff. At least setting timezone to Europe/Berlin seems to give correct time everywhere.

https://github.com/gothfox/Tiny-Tiny-RS ... 7067eb1747

Report results.

Edit2: Also there's an automatic timezone now which uses your browser reported tz offset.

Re: Article Time ahead 1 Hour

Posted: 26 Apr 2013, 13:19
by NemesisRE
fox wrote:
NemesisRE wrote:I have the wrong time too but only on the folder view in the feed view is the right time.


Yeah, I'm also seeing this. For some reason in some situation when a cached timezone object is first created it gives the non-DST offset, but in other cases it works properly. No idea why.

Edit: this is quite strange. Looks like timezone getOffset() is confused (?) by some oldish dates (like 1970-01-01) and doesn't return offset with DST (or maybe there was no DST in 1970s? I dunno.) and with the way it was done previously the offset got stored and screwed all subsequent date calculations. I have changed it to save the timezone object so that offset is calculated correctly for each specified timestamp, which seems to fix stuff. At least setting timezone to Europe/Berlin seems to give correct time everywhere.

https://github.com/gothfox/Tiny-Tiny-RS ... 7067eb1747

Report results.

Edit2: Also there's an automatic timezone now which uses your browser reported tz offset.


Great seams to work! You are fast!

Thanks
Steven