I wouldn't be surprised if there was already a library giving NTP protocol support, but if you can't find one then you would need to write your own. The NTP protocol isn't particularly complex, and you would just need to find a suitable NTP server to sync to. NIST is usually a good bet if you can't find somebody closer, but you may find you already have a time server in your local domain.