Using below code in php
to get current time:
date_default_timezone_set("America/Toronto");
echo date('y-m-d H:i:s', time());
But, there is a time difference of 3 minutes and 30 seconds with real time.
Using below code in php
to get current time:
date_default_timezone_set("America/Toronto");
echo date('y-m-d H:i:s', time());
But, there is a time difference of 3 minutes and 30 seconds with real time.
3 minutes and 30 seconds is not enough to be a timezone issue. No active timezone is shifted only by 210 seconds.
The issue is probably caused by either your server or your local machine being out of sync. Have you checked that your local machine actually matches the current time? Check for example third-party services such as Google to determine if it is your server or local machine that is out of sync.
If it is your local machine, the solution depends on your system. If it is your server, it can be updated with timedatectl --adjust-system-clock
.