gmt 0.8.0 gmt: ^0.8.0 copied to clipboard
Get current datetime in GMT from internet (example.com, google.com or your own urls) and return DateTime in UTC.
import 'dart:async';
import 'package:gmt/gmt.dart';
void main() async {
Timer.periodic(const Duration(seconds: 1), (timer) async {
print(await GMT.now(urls: [
'https://www.example.com',
'https://www.google.com',
], timeoutOfEach: Duration(seconds: 1)));
});
await Future.delayed(const Duration(seconds: 10));
}