When I use following code to get current London time, it gives the wrong time.
At the time of testing the current London time was 02:11:16 PM, Wednesday 01, June 2011, but I using the following code:
date_default_timezone_set('Europe/London');
echo date('m/d/y h:i a', time());
Gave me: 06/02/11 02:12 am
Why did it not return correct London time?
The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.
The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts.
date_default_timezone_set("Europe/London");
try with double quotes. works on godaddy
Check your ini file whether timezone is set or not,
ini_set('date.timezone', 'Europe/London');
Try this it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With