time() wrong inside WordPress
-
php’s time() strangely outputs wrong when called inside WordPress.
I’m pretty sure my server time is setup correctly both Linux & php.
The correct timezone for me is UTC+2. For example let’s say the time is 10:50
linux time: 10:50
php time(): 10:50
inside wp time(): 8:50My timezone setting in wp is also correctly set to Europe. I wonder why this is happening any ideas ?
Here’s a screenshot (dont mind the minutes screenshots taken in between): https://s29.postimg.org/4s80u06nb/wptimmm.jpg
PS: I avoid this confusion by using
$now = current_time( 'timestamp', 0 );
but I don’t want to run an extra function for such a simple thing every time.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘time() wrong inside WordPress’ is closed to new replies.