I like to define time (date) with GMT variable. I try to do it with code like:
PHP Code:
<?PHP $dat = mktime(date("G"), date("i"), date("s"), date("n"), date("j"), date("Y"));
$difference = substr(date("O",$dat),1,2);
$datdif = 60 * 60 * $difference;
if (substr(date("O",$dat),0,1) == '+') {
$dat = $dat - $datdif;
}
else {
$dat = $dat + $datdif;
}
echo date("H:i:s", $dat);//Output
?>
How to define GMT variable to work for all time zones as separate variable?
This works for London time.