When I set the timezone to my current location (eg: Nairobi GMT +3) And then ask for the time using date('Y-m-d'), I get an incorrect value for minutes. i.e if it`s 11:03 AM it shows 11:15 AM (so +12 minutes difference).
Below is the code used. Pretty basic. Gets the job done.
date_default_timezone_set("Africa/Nairobi");
//echo date_default_timezone_get();
echo date('H:i:s');
Also this time difference only occurs in my client`s server. In other test servers , it provides accurate time. i.e 11:03 AM will show 11:03 AM.
Am I required to change the timezone in php.ini as well?
EDIT:
- The project isn`t in localhost.
- The output of time before & after the timezone set is the same :/