Skip to content

A Dart library that finds the time zone name (according to the IANA time zone database) for any position on Earth given by latitude and longitude coordinates in degrees.

License

Notifications You must be signed in to change notification settings

mikljacq/timezone_finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Dart library that finds the time zone name for any position on Earth given by latitude and longitude coordinates in degrees.

The name of the time zone found corresponds to the time zone name as defined in the IANA timezone database (for example: Europe/Madrid or Asia/Shanghai).

The boundaries of the world's time zones used to perform the search have been compiled by the Timezone Boundary Builder from Evan Siroky.

Limitations

The limitations are the same as the Timezone Boundary Builder project.

Performances

The size of the database is about 150 Mo and as there is a huge amount of polygons to parse and as the current version does not use a spatial-aware database, it takes between 3 and 5 seconds to find the time zone name.

At the very first call, it might take more time because the database needs to be decompressed.

Usage

import 'package:timezone_finder/timezone_finder.dart';

void main() async {
  final latitude = 41.29708;
  final longitude = 2.07846;

  final timezoneFinder = TimezoneFinder();
  final timezoneName = await timezoneFinder.findTimezoneName(latitude, longitude);
  print(timezoneName); // Europe/Madrid
}

About

A Dart library that finds the time zone name (according to the IANA time zone database) for any position on Earth given by latitude and longitude coordinates in degrees.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages