Jump to content

Server Time


phpQuestioner

Recommended Posts

This might be linux rdate probem.

 

Anyway, There are NTP servers available. Use this code to query an NTP (Network Time Protocol) Server.

<?php 
function query_time_server ($timeserver, $socket) {
  $fp = fsockopen($timeserver,$socket,$err,$errstr,5);
        # parameters: server, socket, error code, error text, timeout
  if ($fp) {
    fputs($fp,"\n");
    $timevalue = fread($fp,49);
    fclose($fp); # close the connection
  }
  else {
    $timevalue = " ";
  }

  $ret = array();
  $ret[] = $timevalue;
  $ret[] = $err;     # error code
  $ret[] = $errstr;  # error text
  return($ret);

} 
?>

 

http://www.kloth.net/software/timesrv1.php

Link to comment
https://forums.phpfreaks.com/topic/40933-server-time/#findComment-198455
Share on other sites

I keep having trouble with my server's time bouncing up and down in AOL.

 

I don't know what that means, but any time I see the name AOL I think of cache issues and proxy servers as the most likely causes of problems.  Does your 'bouncing up and down' problem appear when other people (using non-AOL services) view the pages?

Link to comment
https://forums.phpfreaks.com/topic/40933-server-time/#findComment-198491
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.