Query an NTP server for the current internet time using Xamarin Forms

There were a couple of threads (here, and here) this week regarding querying an Internet-based time server using Xamarin forms.

The first thing you need to do is download Sockets for PCL from Nuget, written by Ryan Davis. The source may be found here.

Using Ryan’s updated sample code from the second formum thread, I’ve created a sample project using this code in a Xamarin Forms project in case anyone else needs this functionality.