This library retrieve the current time from an NTP server. A method to convert the timestamp from ntc to a human readable format is available in the examples.
class NTPClient(conn_ifc, server="0.pool.ntp.org")
Create an instance of the NTPClient class which allow communication with the NTP Server.
If no server is provided, a default one will be used.
conn_ifc– a connection interface that must be initialized by the user.
server– the server to be used.
Retrieve the current time from the NTP Server. amount of second passed since January 1st 1900 from the NTP Server.
unix_timestamp– Unix flag. Set to
Trueto get the current time as the amount of seconds passed since January 1st 1900 or Epoch (January 1st 1970) respectively.
- The current time as integer.