Jump to content

Real time script


mysterbx

Recommended Posts

Hi,

 

i have made a script that would show the real time (not the servers) for your country,

 

is it possible to make a oneliner from it?

 

maybe an alternative?

 

$gmt = "2";

function thetime() {
global $gmt;
preg_match("#(-|\+)#ise",date("O"),$datematch);
$replace1 = array('"0"','"\+"','"-"');
if($datematch[0]=="+") { $replace2 = "-"; } elseif($datematch[0]=="-") { $replace2 = "+"; }
$getdate2 = date("G")."".$replace2."".preg_replace($replace1,"",date("O"));
eval("\$result=$getdate2;");
$getdate2 = $result+$gmt;
return $getdate2;
}

Link to comment
https://forums.phpfreaks.com/topic/99539-real-time-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.