time_zone_plus 0.0.2 copy "time_zone_plus: ^0.0.2" to clipboard
time_zone_plus: ^0.0.2 copied to clipboard

A Flutter package to get timezone names from UTC offsets for current location of User.

time_zone_plus #

A Flutter package to get timezone names from UTC offsets and country codes.

Features #

  • Get timezone names from UTC offset
  • Get current device timezone(s)
  • Get country code from timezone name
  • Get timezone at specific index
  • Get country code for specific timezone index

Getting started #

dependencies:
  time_zone_plus: ^0.0.2

Usage #

// Get current timezone
String? timezone = TimeZonePlus.getCurrentTimeZone();
print(timezone); // e.g. 'Asia/Kolkata'

// Get all possible timezones for current offset
List<String>? timezones = TimeZonePlus.getCurrentTimeZones();
print(timezones); // e.g. ['Asia/Kolkata', 'Asia/Colombo']

// Get timezone at specific index
String? secondTz = TimeZonePlus.getCurrentTimeZoneAt(1);
print(secondTz); // e.g. 'Asia/Colombo'

// Get country code
String? countryCode = TimeZonePlus.getCountryCode('Asia/Kolkata');
print(countryCode); // 'IN'

// Get country code for current timezone
String? currentCountry = TimeZonePlus.getCurrentCountryCode();
print(currentCountry); // e.g. 'IN'

// Get country code for specific timezone index
String? secondCountry = TimeZonePlus.getCurrentCountryCodeAt(1);
print(secondCountry); // e.g. 'LK'
6
likes
0
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to get timezone names from UTC offsets for current location of User.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on time_zone_plus