ntp 0.0.2 copy "ntp: ^0.0.2" to clipboard
ntp: ^0.0.2 copied to clipboard

outdated

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))}');
213
likes
10
pub points
98%
popularity

Publisher

verified publishersquare-pear.com

Fetch accurate time from NTP server

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on ntp