Articles > Tutorials
PHP Tutorial Here : http://www.w3schools.com/php/
VERY SIMPLY CONVERT GMT TO YOUR TIMEZONE!
set the $TimeDiff with number of hours difference your time zone is from GMT.
Example (PST with Day light savings accounted for):
******************************************
******************************************
$TimeDiff = 7+date('I');
$TimeZoneEpoc = time() - ($TimeDiff*60*60);
$currentDate = date('n/j/y',$TimeZoneEpoc);
$currentTime = date('g:i A',$TimeZoneEpoc);
******************************************
******************************************
the "date('I')" part is where it accounts for day light savings.
PHP
Last Updated: 2/14/10PHP Tutorial Here : http://www.w3schools.com/php/
VERY SIMPLY CONVERT GMT TO YOUR TIMEZONE!
set the $TimeDiff with number of hours difference your time zone is from GMT.
Example (PST with Day light savings accounted for):
******************************************
******************************************
$TimeDiff = 7+date('I');
$TimeZoneEpoc = time() - ($TimeDiff*60*60);
$currentDate = date('n/j/y',$TimeZoneEpoc);
$currentTime = date('g:i A',$TimeZoneEpoc);
******************************************
******************************************
the "date('I')" part is where it accounts for day light savings.
Keywords: timediff time php