Over the course of my life, I cannot figure out how to correctly return the current time in PHP. First let me show you the settings.
Server local time is in CST
I am in PST, so the difference is 2 hours. I also added the following statement to my serverβs htaccess:
SetEnv TZ Amercia / Los_Angeles
Ok and my php instruction for pulling current time
<?php $t = time(); echo(date("D F d Y H:i:s",$t)); ?>
But this code seems to be back 8 hours ahead ... I can't understand why? I want him to return my time PST ...
Thanks guys!
user381800
source
share