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:50
My 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): http://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.
- The topic ‘time() wrong inside WordPress’ is closed to new replies.