GuerrillaNtp /

Filename Size Date modified Message
GuerrillaNtp
GuerrillaNtpTests
NtpCommand
50 B
NuGet release
867 B
Added tag v1.4.1 for changeset 922ba8e216d4
1.8 KB
Test cleanup: project name, mono. linux, NUnit, logging, code style, tolerated packet loss
11.4 KB
License
192 B
Credits
899 B
Fixed example

GuerrillaNtp

GuerrillaNtp is a simple NTP (SNTP) client written in C# that can be embedded in desktop .NET applications to provide them with accurate network time even when the system clock is unsynchronized.

// query the SNTP server
TimeSpan offset;
using (var ntp = new NtpClient(Dns.GetHostAddresses("pool.ntp.org")[0]))
    offset = ntp.GetCorrectionOffset();

// use the offset throughout your app
var accurateTime = DateTime.UtcNow + offset;
  • Homepage - Overview, download, tutorial, alternatives, contact.
  • Documentation - API reference documentation.
  • Sources - Primary repository, preferred for pull requests.
  • License - Distributed under Apache License 2.0.