• Resolved pepin0x

    (@pepin0x)


    Hello.
    How could I sync cache enabler html comment timestamp with my current timezone?

    <!– Cache Enabler by KeyCDN @ Fri, 28 May 2021 00:11:58 GMT (https-index.html) –>

    I think my server config (GMT +2) is fine:

    date ; php -r “echo date(‘r’).PHP_EOL;” ; mysql -e “SELECT NOW();”
    Fri May 28 02:12:09 CEST 2021
    Fri, 28 May 2021 02:12:09 +0200
    +———————+
    | NOW() |
    +———————+
    | 2021-05-28 02:12:09 |

    Cache enabler timestamp is -2hours.
    Btw, I use nginx.

    Thanks!

    • This topic was modified 5 years ago by pepin0x.
    • This topic was modified 5 years ago by pepin0x.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Anonymous User 16850768

    (@anonymized-16850768)

    In version 1.7.0 this was changed to be in the HTTP-date format, which is required to be in GMT.

    The only way to currently change this to your local time zone would be to fork the plugin and make changes to the Cache_Enabler_Disk::get_current_time() method.

    I’ve went ahead and added this request to our list to potentially add a filter hook here for customization.

    Thread Starter pepin0x

    (@pepin0x)

    Hello.

    line 825 from
    $current_time = current_time( 'D, d M Y H:i:s', true ) . ' GMT';
    to
    $current_time = current_time( 'D, d M Y H:i:s');
    so timestamp is adjusted with the GMT offset in the WordPress option. I don’t know if it’s the best approach because I don’t code (but I can read google lol) but looks good for me and works :P.

    Thanks for the tip!

    PD: current_time() | Function | WordPress Developer Resources

    Anonymous User 16850768

    (@anonymized-16850768)

    You’re welcome! Happy to have been able to help.

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

The topic ‘Change html timestamp timezone’ is closed to new replies.