now method

  1. @override
Future<DateTime> now()
override

Retrieves the current DateTime from the configured NTP server.

Opens a UDP socket, sends a standard 48-byte NTP request packet, waits for a response, and computes the clock offset using all four timestamps with full microsecond precision.

Throws an Exception if the hostname cannot be resolved, if the server does not respond within timeout seconds, or if the packet is rejected by RFC 5905 validation.

Implementation

@override
Future<DateTime> now() async {
  final response = await query();
  return response.dateTime;
}