Code first
echo time() . '<br/>';
echo date('Y-m-d H:i:s') . '<br/>';
date_default_timezone_set('America/New_York');
echo time() . '<br/>';
print_r($timezones[$timezone] . '<br/>');
echo date('Y-m-d H:i:s') . '<br/>';
In the above code the date is printed according to timezone but unix timestamp is same even after setting default timezone
How can we print unix timestamp according to timezone?
The answer provided by Volkerk (that says timestamps are meant to be always UTC based) is correct, but if you really need a workaround (to make timezone based timestamps) look at my example.
Get the regular timestamp and add the UTC offset