timezone_provider 0.0.1 copy "timezone_provider: ^0.0.1" to clipboard
timezone_provider: ^0.0.1 copied to clipboard

A Flutter plugin to get the device's IANA timezone name.

timezone_provider #

A Flutter plugin to get the device's IANA timezone name.

Motivation #

Dart's DateTime.now().timeZoneName returns timezone abbreviations like "JST" or "EST", not IANA timezone identifiers. However, IANA timezone names (e.g., Asia/Tokyo, America/New_York) are often required for:

  • Server-side analytics and logging
  • Database storage with proper timezone handling
  • Scheduling and calendar applications
  • Any system that needs unambiguous timezone identification

Why not other packages? #

  • flutter_native_timezone: A well-designed package, but it has not been updated for a long time and has unresolved issues.
  • timezone: Provides timezone database and calculations, but cannot retrieve the device's local timezone identifier.

This plugin provides a simple, maintained solution for accessing the device's IANA timezone identifier from native platform APIs.

Installation #

dependencies:
  timezone_provider: ^0.0.1

Usage #

import 'package:timezone_provider/timezone_provider.dart';

final provider = TimezoneProvider();
final timezone = await provider.getTimezone();
print(timezone); // "Asia/Tokyo"

Platform Implementation #

Platform Implementation
iOS TimeZone.current.identifier
Android TimeZone.getDefault().id
0
likes
150
points
116
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to get the device's IANA timezone name.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on timezone_provider

Packages that implement timezone_provider