How to set the timezone and get the current date and time in PHP

1 Answer

0 votes
date_default_timezone_set('America/Los_Angeles');

$s = date('m/d/Y h:i:s a', time());

echo $s;


/*
run: 

07/05/2017 01:52:24 am

*/

 



answered Jul 5, 2017 by avibootz
...