mysterbx Posted April 4, 2008 Share Posted April 4, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.