getCurrentLocalTime function

Future<TZDateTime> getCurrentLocalTime()

Implementation

Future<tz.TZDateTime> getCurrentLocalTime() async {
  tz.initializeTimeZones();
  final currentTimeZone = await FlutterTimezone.getLocalTimezone();
  tz.setLocalLocation(tz.getLocation(currentTimeZone));
  return tz.TZDateTime.now(tz.local);
}