Title: 2fa Server Time Error
Last modified: May 15, 2019

---

# 2fa Server Time Error

 *  [dloprodz](https://wordpress.org/support/users/dloprodz/)
 * (@dloprodz)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/)
 * Running a CentOS 7 server on a VPS.
 * Checked the server time through ssh shell, checked PHP.ini configuration, checked
   WordPress General Settings. All display my correct local time.
 * When accessing the Login Security/Two-Factor authentication page on the WordPress
   admin page, the server time displayed at the bottom shows UTC time, which is 
   not the same as displayed in any of the other checks I made. As a result I can’t
   activate 2fa.
 * Please help.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2F2fa-server-time-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 40 total)

1 [2](https://wordpress.org/support/topic/2fa-server-time-error/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/2fa-server-time-error/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/2fa-server-time-error/page/2/?output_format=md)

 *  [jameshurrell](https://wordpress.org/support/users/jameshurrell/)
 * (@jameshurrell)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11532685)
 * Yep same here in the UK. I have access to the back end cpanel/WHM server and 
   this is set correctly to my local time. WordPress general settings are also set
   correctly to local time. Wordfence thinks it’s an hour earlier however (UTC)….
 * Seems it’s a general issue, there are other posts like this… Maybe an issue with
   the new version? i’m using the free version (7.3.1) that just introduced 2FA.
 *  [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11532925)
 * Same here in the Netherlands, server time is 2 hours behind. I can’t use 2FA 
   now.
 *  [william68](https://wordpress.org/support/users/william68/)
 * (@william68)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11535701)
 * Same issue – based in London.
 * Any updates on this?
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11536165)
 * Hey All,
 * Can you please check Wordfence > Login Security for the current time being reported?
   It’s located at the bottom left side of the page as `Server Time:`. The time 
   shown there is what your server is reporting as the current UTC time. You’ll 
   want to make sure your device and this time matches. Please be mindful of timezones
   as well.
 * Please let me know.
 * Thanks,
 * Gerroald
 *  Thread Starter [dloprodz](https://wordpress.org/support/users/dloprodz/)
 * (@dloprodz)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11536394)
 * The time displayed IS the correct UTC time, but is not my correct local time.
   My server is set up with UTC-6 time zone, every other source I have checked on
   my server displays the correct server time of UTC-6, but the Wordfence > Login
   Security tab displays my server time as UTC-0.
 * Server Time should NOT arbitrarily == UTC time.
    -  This reply was modified 6 years, 12 months ago by [dloprodz](https://wordpress.org/support/users/dloprodz/).
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11536518)
 * Hey [@dloprodz](https://wordpress.org/support/users/dloprodz/),
 * Can you please try setting your timezone in your php.ini file and let me know
   if it helps?
 * Assuming you’re in North America you can find the syntax here – [https://www.php.net/manual/en/timezones.america.php](https://www.php.net/manual/en/timezones.america.php)
 * Then you’ll want to adjust the timezone like the example below.
 * `date.timezone = "America/Denver"`
 * Please note that this can’t just be added anywhere, it needs to be in the `[Date]`
   block of code.
 * Please give this a try and let me know if it helps.
 * Thanks,
 * Gerroald
 *  Thread Starter [dloprodz](https://wordpress.org/support/users/dloprodz/)
 * (@dloprodz)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11536863)
 * The timezone is correct on the php.ini file.
 * Ran this PHP script and it displays my correct local time:
 *     ```
       <?php
       echo date('Y-m-d G:i:s');
       ?>
       ```
   
 * The timezone is displayed correctly on the WordPress > General Settings tab.
 * The problem resides only on the Wordfence > Login Security tab.
    -  This reply was modified 6 years, 12 months ago by [dloprodz](https://wordpress.org/support/users/dloprodz/).
 *  [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11537326)
 * I checked the server time with my webhost, and the server time is setup 100% 
   good!
 * This looks like some kind of bug in the latest WordFence version, because the
   server time is only wrong in WordFence.
 *  [jameshurrell](https://wordpress.org/support/users/jameshurrell/)
 * (@jameshurrell)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11537510)
 * I investigated a bit more here. Current situation:
 * WHM Server time is set to: “Europe/London” and shows correct local time
    Wordpress
   Timezone is set to “London” and shows correct local time WordFence shows local
   time minus one hour (UTC) preventing 2FA from working
 * I then uploaded a test.php file to a cpanel domain containing:
 *     ```
        echo date('Y-m-d G:i:s');
        echo strftime("%c");
       ```
   
 * Loading this file in a browser showed the time was local time minus one hour (
   UTC) – OK then something not right here, so I then took a look at my php.ini 
   file and found:
 * `date.timezone = "UTC"`
 * I changed this to:
 * `date.timezone = "Europe/London"`
 * I rebooted WHM and then I reloaded the test.php file. This time the correct local
   time is showing in the php date output. Yay I thought….
 * So I then go back into WordPress and check out “Server Time” in the WordFence
   2FA section… sadly it is still showing local time minus one hour preventing 2FA
   from working.
 * I don’t know where WordFence is picking up the time from….
 *  [elkahina](https://wordpress.org/support/users/elkahina/)
 * (@elkahina)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11537573)
 * I can confirm too, this most likely a bug on the latest version of Wordfence,
   all possible option to set the date do not work, I have few website with different
   hosting companies, all have the same issue.
 * May the next update will fix the issue.
 *  Thread Starter [dloprodz](https://wordpress.org/support/users/dloprodz/)
 * (@dloprodz)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11538739)
 * After all tests ran and seeing everybody is getting the same issue, I’m now almost
   certain the problem is in the Wordfence code, it must be requesting the server’s
   UTC time instead of the server’s actual local time.
 * Please check that on your side as we have tried everything you have suggested
   on our side.
 * Thank you.
 *  [jameshurrell](https://wordpress.org/support/users/jameshurrell/)
 * (@jameshurrell)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11538779)
 * I had a look in the WordFence plugin files – this is where I think it is getting
   the time from, right at the end of the file:
 * `wordfence.7.3.1\wordfence\modules\login-security\classes\controller\time.php`
 * I’m not sufficiently good at PHP though to understand what it is doing. It does
   mention UTC in there though.
 *  [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11543863)
 * I have updated to version 7.3.2 but the server time displayed by WordFence is
   still 2 hours behind…
    -  This reply was modified 6 years, 12 months ago by [Alwin](https://wordpress.org/support/users/wp-opti/).
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11544099)
 * Hi All,
 * Wordfence is requesting the UTC time, and as long as it’s correct it should work
   just fine.
 * In **Settings > General** does your `Universal time (UTC) is` match the `Server
   Time:` Found on the bottom left of the **Wordfence > Login Security** page?
 * Thanks,
 * Gerroald
 *  [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/2fa-server-time-error/#post-11544148)
 * Wordfence>Login Security is showing this server time right now:
    Server Time:
   2019-05-17 17:52:39
 * But the correct time is now 19:53:39 !!
 * So 2FA is still not working for me! I have checked with my hosting company and
   run some tests myself to check if the server time is correct, and it is.
 * Also, I have the same problems on other webistes that are hosted by 2 different
   webhosters.

Viewing 15 replies - 1 through 15 (of 40 total)

1 [2](https://wordpress.org/support/topic/2fa-server-time-error/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/2fa-server-time-error/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/2fa-server-time-error/page/2/?output_format=md)

The topic ‘2fa Server Time Error’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [2fa](https://wordpress.org/support/topic-tag/2fa/)

 * 40 replies
 * 6 participants
 * Last reply from: [BenLinders](https://wordpress.org/support/users/benlinders/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/2fa-server-time-error/page/3/#post-13324765)
 * Status: not resolved