Title: Wrong timezone even when set right
Last modified: May 21, 2024

---

# Wrong timezone even when set right

 *  [lamatryoshka](https://wordpress.org/support/users/lamatryoshka/)
 * (@lamatryoshka)
 * [2 years ago](https://wordpress.org/support/topic/wrong-timezone-even-when-set-right/)
 * My client’s site needs to display a lot of content based on the time of the day,
   and currently, even if I set it right in the admin dashboard (UTC -4 or America/
   New_York : We are in Montreal), my code ( date(“D M j G:i:s T Y”) ) shows the
   time with 4 hours more…
 * Because it’s a custom theme, I did try on two other sites : same issue. It always
   shows the Universal time.
 * I’ve tried to override it in php.ini, and .htaccess, no success..

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

 *  [Kunjan Gohel](https://wordpress.org/support/users/gohelkunjan/)
 * (@gohelkunjan)
 * [2 years ago](https://wordpress.org/support/topic/wrong-timezone-even-when-set-right/#post-17771122)
 * [@lamatryoshka](https://wordpress.org/support/users/lamatryoshka/) 
   You can use
   wordpress function. Maybe helpul.[https://developer.wordpress.org/reference/functions/current_time/](https://developer.wordpress.org/reference/functions/current_time/)
 *     ```wp-block-code
       <?php
   
       echo "current_time( 'mysql' ) returns local site time: " . current_time( 'mysql' ) . '<br />';
       echo "current_time( 'mysql', 1 ) returns GMT: " . current_time( 'mysql', 1 ) . '<br />';
       echo "current_time( 'timestamp' ) returns local site time: " . date( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) );
       echo "current_time( 'timestamp', 1 ) returns GMT: " . date( 'Y-m-d H:i:s', current_time( 'timestamp', 1 ) );
   
       ?>
       ```
   
 *  [twistysnacks](https://wordpress.org/support/users/twistysnacks/)
 * (@twistysnacks)
 * [2 years ago](https://wordpress.org/support/topic/wrong-timezone-even-when-set-right/#post-17771194)
 * date() is a PHP function, not a WordPress function. It will *always* use the 
   server time, which is typically set to GMT.
 * [@gohelkunjan](https://wordpress.org/support/users/gohelkunjan/) is correct, 
   you need to use the WordPress function.

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

The topic ‘Wrong timezone even when set right’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [twistysnacks](https://wordpress.org/support/users/twistysnacks/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/wrong-timezone-even-when-set-right/#post-17771194)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
