Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Time problem with Advanced RSS Ticker

  1. #1
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Time problem with Advanced RSS Ticker

    Hi
    I have a problem with the Advanced RSS ticker
    (http://www.dynamicdrive.com/dynamici...ajax/index.htm)

    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
    www.typicallyspanish.com

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    HTML Code:
    www.typicallyspanish.com/news.xml
    with 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

    howard

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default when you find time, ha ha

    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
    thanks
    howard

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, you could try changing this (in rssticker.js):

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

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    thanks
    howard

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •