ntp 0.0.2
ntp: ^0.0.2 copied to clipboard
Fetch accurate time from NTP server
ntp #
Get local clock offset in milliseconds from NTP services
Add offset from getNtpTime
example:
NTP ntp = new NTP();
DateTime startDate = new DateTime().now().toLocal();
int offset = await ntp.getNtpTime(localTime: startDate);
print('NTP Align: ${startDate.add(new Duration(milliseconds: offset))}');