D implementation of SNTP client
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


DigitalMars D SNTP client.

This module allows get time from ntpserver with very low precision (1s).

See wikipedia for details: http://en.wikipedia.org/wiki/Network_Time_Protocol

Author: Bystroushaak (bystrousak@kitakitsune.org)
Version: 1.0.0
Date: 07.08.2011

enum LeapIndicator;
enum Mode;

struct SNTPmsg;
    SNTP packet.

    For details, see RFC 1361 (http://www.faqs.org/rfcs/rfc1361.html)

SNTPmsg getSNTPmsg(string server, ushort port = 123);
    Get SNTP packet from server.

uint32_t toUnixTimestamp(uint64_t t);
    Convert time from NTP timestamp to Unix timestamp.

    Function is checking endianity, so it should works on every platform.

    Thx to http://arduino.cc/forum/index.php/topic,51802.msg369313.html#msg369313

uint32_t getUnixTimestamp(string server, ushort port = 123);
    Get time from ntpserver and return it converted into 32b unix timestamp.

Page generated by Ddoc. This work is licensed under a Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/).