• There seems to be a discrepancy in time between time() and WordPress time. The WordPress site stamps time correctly on posts (we use Pacific Time), but time() seems to be 8 hours ahead. I have already changed the time in the PHP.INI files for Vancouver, and have also set the time zone in the WP settings and manually in the database in WP_options in UTC_offset for -8. I need to get time() on Pacific time…is there a way to fix this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Do you mind posting your php.ini?

    It should be changed using:

    date.timezone=”America/Vancouver”

    Thread Starter achanne

    (@achanne)

    Hi, here is the Date/Time section of the PHP.INI file. The problem is that the server time needs to match WP time so that scheduled posts can appear at the right time in Pacific (Vancouver) time.

    [Date]
    ; Defines the default timezone used by the date functions
    ; https://php.net/date.timezone
    date.timezone = “America/Vancouver”

    ; https://php.net/date.default-latitude
    ;date.default_latitude = 31.7667

    ; https://php.net/date.default-longitude
    ;date.default_longitude = 35.2333

    ; https://php.net/date.sunrise-zenith
    ;date.sunrise_zenith = 90.583333

    ; https://php.net/date.sunset-zenith
    ;date.sunset_zenith = 90.583333

    Thread Starter achanne

    (@achanne)

    Problem solved: If you change the timezone in WP, scheduled posts written BEFORE the change will show up based on the PREVIOUS timezone setting. However, all scheduled posts written AFTER the change will show at the correct time.

    If this has to do with post scheduling, no further action is required after changing the time zone in WP and in the database. Unless, of course, you still have scheduled posts from before change, then you would have to add/subtract hours from scheduled time or just copy and paste everything into a new post and reschedule.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Time Zone Discrepancies’ is closed to new replies.