• Resolved Guido

    (@guido07111975)


    Hi,

    The “Plugin Check” plugin returns this warning when inspecting a plugin:
    Using date_default_timezone_set() and similar isn’t allowed, instead use WP internal timezone support.

    This plugin saves dates without timezone offset in database, I’m using strtotime() for this.

    Before saving I force timezone to be UTC+0, so that other plugins cannot intervene (on purpose or by accident):

    // get current timezone
    $current_zone = date_default_timezone_get();
    // set utc timezone for strtotime
    date_default_timezone_set('UTC');
    
    

    Apparently I should use native WP functions for this.
    What’s the best way to do this?

    Guido

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Force timezone to be UTC+0’ is closed to new replies.