Skip to content

Instantly share code, notes, and snippets.

@waqasy
Created July 5, 2018 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waqasy/93c8f6c008adf90c05562e359db12dab to your computer and use it in GitHub Desktop.
Save waqasy/93c8f6c008adf90c05562e359db12dab to your computer and use it in GitHub Desktop.
get PST date time in php
<?php
$timezone = -8; //(GMT -5:00) EST (U.S. & Canada)
$date = new DateTime("now", new DateTimeZone('America/Los_Angeles') );
echo $date->format('j F Y, h:i:s A').'<br>';
echo gmdate("Y/m/j H:i:s", time() + 3600*($timezone+date("I")));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment