• Resolved arijuki

    (@arijuki)



    You must be setting the timezone to something unexpected, as this is causing a conflict with another plugin (My Calendar). It is showing a current date with different color and in my case that happens two hours too early.

    Most likely you are setting timezone based on my location EET (Helsinki/Europe or UTC +2) which you should not do. This behaviour has been tested and is definetely because of Feed Them Social. If I add a setting before the other plugin placed in footer ( date_default_timezone_set( ‘Etc/UTC’ ); ), it works as expected.

    Some testing – Real time in Helsinki, EET is 22:56:24 but now it is messed up, in pages your plugin (widget) is in use WordPress thinks the above is UTC time, which adds two hours extra. Below what my installation prints out:

    $now = current_time( ‘timestamp’ ): 1520895384
    Using date( “Ymd”, $now ): 20180313
    Using date( “D M j G:i:s T Y”, $now ): Tue Mar 13 0:56:24 EET 2018
    Using date_i18n( “Ymd”, $now ): 20180313
    Using date_i18n( “D M j G:i:s T Y”, $now): ti maalis 13 0:56:24 EET 2018

    From WordPress settings:
    Timezone format: Y-m-d H:i:s
    Offset: 2
    Timezone string: Europe/Helsinki
    Date format: j.n.Y

    Time using timezone_format!
    UTC – date_i18n( $timezone_format, false, true ): 2018-03-12 22:56:24
    EET – date_i18n( $timezone_format ): 2018-03-13 00:56:24

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author slickremix

    (@slickremix)

    Did you try going to the Settings page then global options tab… that page has an area where you can change the time zone etc.?

    I have had it set to GMT +02:00 Cairo, because there is no Helsinki. Result is:
    $now = current_time( ‘timestamp’ ): 1520934388
    Using date( “Ymd”, $now ): 20180313
    Using date( “D M j G:i:s T Y”, $now ): Tue Mar 13 11:46:28 EET 2018
    Using date_i18n( “Ymd”, $now ): 20180313
    Using date_i18n( “D M j G:i:s T Y”, $now): ti maalis 13 11:46:28 EET 2018

    From WordPress settings:
    Timezone format: Y-m-d H:i:s
    Offset: 2
    Timezone string: Europe/Helsinki
    Date format: j.n.Y

    Time using timezone_format!
    UTC – date_i18n( $timezone_format, false, true ): 2018-03-13 09:46:28
    EET – date_i18n( $timezone_format ): 2018-03-13 11:46:28

    If I change it to GMT Greenwich Mean Time, result is:
    $now = current_time( ‘timestamp’ ): 1520934639
    Using date( “Ymd”, $now ): 20180313
    Using date( “D M j G:i:s T Y”, $now ): Tue Mar 13 9:50:39 GMT 2018
    Using date_i18n( “Ymd”, $now ): 20180313
    Using date_i18n( “D M j G:i:s T Y”, $now): ti maalis 13 9:50:39 EET 2018

    From WordPress settings:
    Timezone format: Y-m-d H:i:s
    Offset: 2
    Timezone string: Europe/Helsinki
    Date format: j.n.Y

    Time using timezone_format!
    UTC – date_i18n( $timezone_format, false, true ): 2018-03-13 07:50:39
    EET – date_i18n( $timezone_format ): 2018-03-13 09:50:39

    Latter is correct according to my understanding. Not really specialist in this area, but I have understood that WordPress internally is using GMT/UTC and with functions like current_time or date_i18n it will be converted to local time. If you set PHP timezone to something else, it is not functioning as it should.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set timezone and plugin conflict’ is closed to new replies.