Last active
March 24, 2019 14:13
-
-
Save angeloped/7119e1815a4adc18b35dac9582d05aa7 to your computer and use it in GitHub Desktop.
Unix timestamp by timezone in PHP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# note: $_REQUEST["tz"] is variable of your timezone. arg example: Asia/Manila | |
if(isset($_REQUEST["tz"])){ | |
date_default_timezone_set($_REQUEST["tz"]); | |
$datetime = new DateTime(); | |
echo $datetime->format('Y-m-d H:i:s'); | |
die(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment