nowToIsoString static method
Returns the current accurate time as an ISO 8601 string.
isUtc defaults to true (UTC).
Implementation
static Future<String> nowToIsoString({
bool isUtc = true,
NtpServer server = NtpServer.google,
String? customServer,
List<NtpServer>? fallbackServers,
int port = 123,
int timeout = 5,
int samples = 1,
bool forceRefresh = false,
bool allowFallback = true,
}) async {
final time = await now(
isUtc: isUtc,
server: server,
customServer: customServer,
fallbackServers: fallbackServers,
port: port,
timeout: timeout,
samples: samples,
forceRefresh: forceRefresh,
allowFallback: allowFallback,
);
return time.toIso8601String();
}