Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
NTP Protocol handling class
integer $_port = '123'NTP port number (123) assigned by the Internet Assigned Numbers Authority
Details__construct(
string $timeserver, integer $port
=
123
)
:
NTP class constructor, sets the timeserver and port number
Details_extract(
string|array $binary
)
:
integerExtracts the binary data returned from the timeserver
Details_getFloat(
string $input
)
:
floatCalculates a 32bit signed fixed point number
Details_getInteger(
string $input
)
:
integerCalculates a 32bit integer
Details_getTimestamp(
string $input
)
:
floatCalculates a 64bit timestamp
Details_prepare(
)
:
stringPrepare local timestamp for transmission in our request packet
NTP timestamps are represented as a 64-bit fixed-point number, in seconds relative to 0000 UT on 1 January 1900. The integer part is in the first 32 bits and the fraction part in the last 32 bits
Details_read(
)
:
arrayReads the data returned from the timeserver
This will return an array with binary data listing:
Details_write(
string $data
)
:
voidSends the NTP packet to the server
Details