NTP Protocol handling class
category | Zend |
---|---|
package | Zend_TimeSync |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_TimeSync_Protocol |
__construct(string $timeserver, integer $port = 123
)
string
Adress of the timeserver to connect to
integer
(Optional) Port for this timeserver
getDate(string|\Zend_Locale $locale = null
) : \Zend_Date
string
\Zend_Locale
(Optional) Locale
\Zend_Date
getInfo() : array
array
_connect() : void
\Zend_TimeSync_Exception |
When the connection failed |
---|
_disconnect() : void
_extract(string|array $binary) : integer
inherited_from | \Zend_TimeSync_Protocol::_extract() |
---|
string
array
Data returned from the timeserver
integer
Difference in seconds_extract(string|array $data) : integer
string
array
Data returned from the timeserver
integer
_getFloat(string $input) : float
string
float
_getInteger(string $input) : integer
string
integer
_getTimestamp(string $input) : float
string
float
_prepare() : string
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
inherited_from | \Zend_TimeSync_Protocol::_prepare() |
---|
string
_prepare() : mixed
mixed
_read() : array
This will return an array with binary data listing:
inherited_from | \Zend_TimeSync_Protocol::_read() |
---|
\Zend_TimeSync_Exception |
When timeserver can not be connected |
---|
array
_read() : mixed
mixed
_write(string $data) : void
inherited_from | \Zend_TimeSync_Protocol::_write() |
---|
string
Data to send to the timeserver
_write(string $data) : void
string
Data to write
$_exceptions : array
$_info : array
array()
$_port : integer
123
$_socket : array
$_timeserver : string