View Full Version : Time problem with Advanced RSS Ticker

03-31-2006, 04:04 PM
I have a problem with the Advanced RSS ticker

My server time is correct - as indicated by the time written by other software on my site - but since Summer Time last week I've noticed the time on the ticker is now an hour ahead (ie the old time for winter)

How can I change it without changing the server time which is correct for here in Spain -
The home page shows ticker and same stories with different times

03-31-2006, 04:27 PM
I'm a little confused, where is the correct time on your page exactly? Also, I wonder if the times reported by the feeds are not accurate representations of the prevailing time in their location of origin. The way that you describe it, it sounds like they could be. If they are accurate for the feed's place of origin, then that certainly is OK for a professional presentation. My question would be is there a different standard in use in your location as regards 'summer time' (here in the states referred to as 'daylight savings time' and it hasn't started yet, as far as I know) than in the location of origin of the feeds? If so, you could just make an adjustment based on the date but, you might have to update this periodically as the situation changes throughout the years.

As an example, at one time, I frequently called Mexico. The time in the location there did not change with the US changes, this made it odd but not impossible to time calls to a particular local hour.

If, on the other hand, both your local time and the feeds' local time has shifted by the same amount and you are still having a problem, there should be some relatively easy fix.

03-31-2006, 05:05 PM
Sorry John - should have explained better.

My apache server reset automatically to the new time last week - and so news stories printed on the site are giving the correct local time of being posted.

The RSS feed I generate
www.typicallyspanish.com/news.xmlwith this also has the correct time for new postings.
But for some reason when the ticker reads this it adds an hour - it used to be OK and in sync.

Is it possible for PHP to run a different time from the actual server? - I wonder if stopping and starting PHP might correct the problem

any ideas?

many thanks for a quick response


03-31-2006, 05:39 PM
If the PHP code or the javascript has a routine that checks the date and adjusts the seasonal time, you would need to disable that as the server is already doing the job. The code may assume UT from the server, which by definition, never changes. You can go through the PHP and javascripts to see if there is an adjustment routine or (hopefully) a configuration setting to enable/disable daylight/summertime adjustments. I would do it for you but, at the moment I am a bit pressed for time (no pun intended). If I get a chance I will check.

03-31-2006, 09:43 PM
If you could check - I did look and there does appear to be time commands but to be honest I would not know what to try

04-02-2006, 04:06 PM
I did but, I couldn't find anything obvious. My PHP is a little weak though. I'm wondering if now, now that most of the entire world has changed their clocks if they are going to at all, it isn't working again as expected?

04-02-2006, 07:22 PM
Hi again - 'fraid not - still an hour difference between the scroller and my server time - as reflected by the time stories are posted.
The PHP on the server must be running its own clock somehow but it's beyond me. - thanks for your efforts

04-02-2006, 08:02 PM
Well, you could try changing this (in rssticker.js):

var parameters="id="+encodeURIComponent(this.RSS_id)+"&cachetime="+this.cachetime+"&bustcache="+new Date().getTime()


var parameters="id="+encodeURIComponent(this.RSS_id)+"&cachetime="+this.cachetime+"&bustcache="+new Date(new Date().setHours(new Date().getHours()-1)).getTime()

You would have to change it back in the fall or just change the 1 to a zero. I'm not certain if this will work but, there is a good chance. If not, I may be able to find another approach.

04-03-2006, 01:40 PM
Hi again and thanks again for your efforts on this silly problem .-

Still no joy - still the ticker prints an hour after the story is posted and an hour after the time in the xml file.

I wonder if the Cache could be doing something here?

I have come up with a workround here - if you want to leave this - that would be to alter the main server time to as it was - and then compensate on the news posting programme as that has a time change function built in -

It would be a case of two wrongs making a right - if you see what I mean
If you think that's my best option let me know

04-03-2006, 03:20 PM
I've figured out a test that can determine if the local machine is using an official time set ahead. Since, as far as I know, no one sets their clocks ahead by more than one hour as part of any official time change recognised by computers, this might be able to be used somehow, I'm just not sure how yet, here is the test:

var dstTest=new Date()
var stTest=Math.ceil((dstTest.valueOf()-new Date(dstTest.setMonth(0)).setDate(1))/(1000*60*60*24)%1)

The stTest variable will equal 1 if the user's time is set ahead of his/her local standard time zone, 0 if it is not.

04-04-2006, 05:16 PM
Hi John -
How do I run the test -
I checked UNIX server time on telnet and it is correct - the ticker though remains an hour fast.
I wonder if the problem is in the parsing script somehow - lastrss
Why the script can't simply parse the time from the rss file (which is also correct) I don't know!