If you work with dates and time most of the times, setting up timezones must be your first priority to get accurate results. Using the following snippet you can get and set timezones in php You can find the list of supported timezones from the php official site. To set a timezone use the below snippet.
1 2 3 4 5 6 7 8 9 |
// prints timezone for Nigeria. date_default_timezone_set('Westafrica/Nigeria'); echo date("d-m-Y h:i:s A"); echo "<br>"; // prints timezone for london. date_default_timezone_set('Europe/London'); echo date("d-m-Y h:i:s A"); |
To […]