WordPress.org

Ready to get started?Download WordPress

Forums

Latest Tweets Widget
[resolved] Time Zone Off (11 posts)

  1. junger
    Member
    Posted 1 year ago #

    Hi there

    Great plugin. I'm having an issue where the time zone displayed in the widget seems to be off by a few hours - 3 if my math is correct - from the actual tweet.

    Is this something on the plugin end or server end?

    Site: http://www.getupwithgod.com - you can see the latest tweets on the right-hand sidebar.

    Thanks!

    http://wordpress.org/extend/plugins/latest-tweets-widget/

  2. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    Hi.
    This plugin uses WordPress's internal date formatting, which in turn use PHP's internal date formatting, which in turn uses your server's operating system.

    As far as I can tell your tweet times are accurate in UTC.
    Based on this I'd guess that your server is configured to use UTC instead of your timezone.

    If you think there really is an error in my relative time calculations, then please post the tweet that is incorrect, the time you tweeted it and the time your site is saying you tweeted it. Looking at your last three tweets, it seems to make sense with regard to my points above.

  3. timwhitlock
    Member
    Plugin Author

    Posted 11 months ago #

    closed after a week with no follow up. I can't see a problem with the plugin

  4. evster
    Member
    Posted 9 months ago #

    Just wanted to note that I'm having the same problem with the timestamp on the embedded tweet not matching up with the timestamp from twitter. The time zone appears to be off by several hours.

    This has been noted on 2 separate sites which are using this plugin. On both sites the time zone has been properly configured in the WordPress settings.

    Is there something else I need to be doing?

    Thanks!

  5. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    Can you provide links that demonstrate this please?

  6. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    Hello all.

    I've looked further into this and made a fix in the current Development Version.

    I'd appreciate it if you could test this version out and if it appears stable, I'll publish it to 1.0.14.

    Some info in case someone's googling WordPress timezone problems:

    WordPress allows you to set your timezone in admin settings (the WP option is called 'timezone_string'), but PHP knows nothing about this unless it is passed to the native date_default_timezone_set.

    WordPress kindly does this on the admin screen where you set the timezone option, but this won't persist and nowhere else in the system does this get set. The rest of the time your system is forced into UTC and WordPress tries to handle things itself. However, if you try to format a date with a timezone, all WP does is tack the offset onto the end of the date, creating an incorrect date.

  7. junger
    Member
    Posted 9 months ago #

    Hey Tim - thanks for looking into this.

    I've installed the dev version on two sites, and am still seeing times off by 3 hours (for east coast time - 2 hours if the site is set for central time).

    Is it not possible to grab the time straight from the Tweet itself?

  8. timwhitlock
    Member
    Plugin Author

    Posted 9 months ago #

    the time does come from the Tweet itself, and Twitter provide it in UTC. WordPress then has to convert it based on your timezone setting, which is what is failing for you.

    Can you please post a link to an example Tweet?

  9. evster
    Member
    Posted 8 months ago #

    Apologies for not following up on this sooner.

    The site that I'm getting this problem on is [link deleted].

    If you click on the permalink for the tweet itself, you'll see that Twitter's official timestamp is several hours off from what the plugin is displaying.

    The timezone for this site in question is set to "Los Angeles" within the WP admin panel.

    Please let me know if there is any other information that I can provide.

    Thanks.

  10. evster
    Member
    Posted 8 months ago #

    D'oh! Please excuse my last post.

    I realized your plugin had an update available. Just applied the update and now all is fixed.

    Thanks again!

  11. timwhitlock
    Member
    Plugin Author

    Posted 8 months ago #

    No problem.
    Good to know the fix is working for others.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic