Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    Hi,

    1. Posting from the back or frontend?
    2. Is the date in the backend correct?
    3. Does this happen to other post types, such as posts?
    4. Can you screenshot me your WP timezone settings.

    Thanks

    Thread Starter 99interns

    (@99interns)

    1. The posts are created by the client (front end)
    2. The date in the back end look to be correct for the Sydney timezone
    3. Posts (blog posts) seem to be OK but it could also be because we don’t have a time on it just a date… ie the one just posted says 20 October and it was published 9 minutes ago
    4. screenshot of timezone settings:
    http://cloud.screenpresso.com/enSrg/2014-10-20_08h55_13.png
    (included my system tray so you can see our local time)

    Plugin Author Mike Jolley

    (@mikejolley)

    This is the code in question:

    <li class="date"><date><?php printf( __( '%s ago', 'wp-job-manager' ), human_time_diff( get_post_time( 'U' ), current_time( 'timestamp' ) ) ); ?></date></li>

    get_post_time gets the localised time: http://codex.wordpress.org/Template_Tags/get_post_time

    current_time gets the local time too:
    http://codex.wordpress.org/Function_Reference/current_time

    I suspect something in your environment (plugin, custom code) is breaking 1 of these functions. Are you able to var_dump() their values to see which one?

    Thread Starter 99interns

    (@99interns)

    I installed a debug tool and did a Plugin Variables (is this the same data out of var_dump? — any clues on what I’m looking for?

    This is under wp_filter
    [503] => delete_option_timezone_string
    [504] => update_option_timezone_string
    [505] => add_option_timezone_string

    and under itsec_globals
    [11] => current_time
    [12] => current_time_gmt

    The other settings all look OK?

    Plugin Author Mike Jolley

    (@mikejolley)

    If you temporarily edit your theme’s footer.php and add:

    <?php
    var_dump( date( get_option( ‘time_format’ ), current_time( ‘timestamp’ ) ) );
    ?>

    Lets see if that time matches your settings. Remove it when you’ve checked.

    Thread Starter 99interns

    (@99interns)

    OK that is showing the wrong time

    string(7) “6:46 pm”

    (it’s currently 7.46am here)

    And I’m removing it now…

    Plugin Author Mike Jolley

    (@mikejolley)

    Right – this is why you’re seeing the issue. Something you have must be changing it. If you view the docs for the function:

    http://codex.wordpress.org/Function_Reference/current_time

    Returns the blog’s current local time in the specified format.

    The local time returned is based on the timezone set on the blog’s General Settings page, which is UTC by default.

    You’ll need to look into why this isn’t working on your install.

    Thread Starter 99interns

    (@99interns)

    Thanks Mike! Appreciate your help esp as it’s really got nothing to do with either WP Job Manager or Jobify (both of which we love)

    Plugin Author Mike Jolley

    (@mikejolley)

    Good luck with your search 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Time stamp?’ is closed to new replies.