Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    The screenshot you have attached shows me your computer’s time zone setting, and not the timezone setting of your WordPress installation.

    View post on imgur.com

    Please go to your WordPress site admin, look under the site’s General Settings area and check that you have selected New York in the list of cities for the Time Zone configuration.

    If it was already set to New York, check to see if the UTC time reported below the list is accurate. If it is not, then the problem is that your hosting company has not properly configured the server clock on its servers.

    Thread Starter dleer58

    (@dleer58)

    As I initially stated, my theme time zone is set for New York. The local time showing under that field is correct as is the time on my server. I have my own web server set up in my office (no hosting company).

    I just posted a new link on my site and the time displayed is 6:29am. On my theme settings page, the UTC time is 14:29 and the local time is 10:29…

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    I know what you stated, but the screenshot you attached did not show me how your WordPress installation was configured in any way, so that led me to believe that you had misconfigured it.

    As a way of troubleshooting this further, I propose that you make a small modification to the plugin that will only appear in your admin dashboard.

    Go to line 600 of link-library-admin.php and add the following line of code after $linkmoderatecount = 0;

    echo date( "Y-m-d H:i", current_time( 'timestamp' ) );

    This should display in the Link Library widget on your dashboard the date as reported by the WordPress current_time function, which is called to prepare a date to be stored when links are created. Please check if that date is correct.

    Thread Starter dleer58

    (@dleer58)

    I added that code and the displayed time is still off…
    Screenshot here: https://goo.gl/rJBdH1
    My computer time on the left, link time on the right

    Thanks

    Thread Starter dleer58

    (@dleer58)

    As another test, I created a new page. The creation time is correct.
    See screenshot: https://goo.gl/hiXieE

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    I am a bit baffled. current_time is supposed to return the site time, as adjusted by the WordPress time zone setting. Searching on the WP forums, I am seeing a single case of someone having the same issue that you are having:

    https://wordpress.org/support/topic/current_timetimestamp-gives-incorrect-time-bug?replies=14

    There was no good response in that thread.

    Which Windows-based web server are you running?

    Thread Starter dleer58

    (@dleer58)

    Server is running Windows 2012 R2 fully patched, Microsoft-IIS/8.5, MySQL 5.6.30, PHP 5.6.0.

    I added the following code in the link-library-admin.php file:

    echo "current_time( 'mysql' ) returns local site time: " . current_time( 'mysql' ) . '<br />';
    echo "current_time( 'mysql', 1 ) returns GMT: " . current_time( 'mysql', 1 ) . '<br />';
    echo "current_time( 'timestamp' ) returns local site time: " . date( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) ) . '<br />';
    echo "current_time( 'timestamp', 1 ) returns GMT: " . date( 'Y-m-d H:i:s', current_time( 'timestamp', 1 ) ) . '<br />';

    The result is shown in this screenshot: https://goo.gl/WeLy43

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    It is very strange for the mysql and timestamp versions of the time to be different. Since current_time is a core WordPress function, I can see about reporting the issue.

    For your current need, I will modify Link Library so that it uses the MySQL time instead of the timestamp. In any case, I was formatting the timestamp to look like an SQL date, so this will actually be slightly more efficient. I will be able to push a new version out tonight.

    If you want an immediate fix, replace all instances of date( “Y-m-d H:i”, current_time( ‘timestamp’ ) ) in Link Library with current_time( ‘mysql’ ) and I think it will work correctly.

    Please consider donating to support this plugin’s development.

    Thread Starter dleer58

    (@dleer58)

    Hold on…

    The problem seems to come from another plugin: Ajax Event Calendar

    If I deactivate that plugin, current_time( ‘timestamp’ ) returns the correct time. If I activate it, the timestamp is 4 hours behind.

    I’m searching around to see if there’s a fix somewhere…

    Thanks

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Did that plugin stopped being maintained? I cannot find it on the WordPress plugin repository. I wonder if they do weird things to the PHP timezone settings.

    I can take a look through the code if you send it to me. You can upload a file through my contact form: ylefebvre.ca/contact-me.

    Thread Starter dleer58

    (@dleer58)

    The author just sold the plugin to AppSumo… I haven’t found where they have made it available and the existing forum does not address my issue.
    I will send you the plugin zip file…
    Thanks

    I’m having the same issue with the timestamp being wrong. My local time right now is 10:34am but the link timestamp is displaying as 4:34pm.

    I added the test code to link-library-admin.php and the time in the dashboard shows correctly as 10:34am.

    I am testing this on a fresh installation of WP with no other plugins installed.

    WP Settings > General is set to the correct time zone and displays the current time currently there.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Posting time’ is closed to new replies.