Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Timezone Issue: UCT Time Incorrect

Discussion in 'Misc WordPress Requests' started by mashirozx, Mar 26, 2018.

  1. mashirozx

    Guest

    Timezone Issue: UCT Time Incorrect, by mashirozx

    It shows: Universal time (UTC) is 2018-03-26 20:25:00. Local time is 2018-03-27 04:25:00.

    But actually the UTC time 2018-03-26 20:25:00 was my local time, and the correct UTC time should be 2018-03-26 12:25:00.

    I’m sure not system/PHP problem. I do have tried to select WordPress Timezone as Shanghai/UTC+8, none works correctly. Now if I post a new comment, it will show as post 8 hours ago.

    System time (CST = China Stand Time):
    `
    # date
    Mon Mar 26 20:25:00 CST 2018
    `

    php.ini:
    `
    date.timezone = Asia/Shanghai
    `

    In this single PHP file, it shows as Current time is 08:25:00pm:
    `
    <?php
    date_default_timezone_set(“Asia/Shanghai”);
    echo “Current time is ” . date(“h:i:sa”);
    ?>
    `

    Timezone Issue: UCT Time Incorrect
     
    #1

Share This Page

Monarch Social Sharing Plugin