mobile_date_tz 0.1.2 copy "mobile_date_tz: ^0.1.2" to clipboard
mobile_date_tz: ^0.1.2 copied to clipboard

Port of the DateTz timezone utility for Flutter and Dart.

example/mobile_date_tz_example.dart

import 'package:mobile_date_tz/mobile_date_tz.dart';

void main() {
  DateTz.initializeTimezones();

  final romeNow = DateTz.now('Europe/Rome');
  print("Rome now: ${romeNow.format('YYYY-MM-DD HH:mm')}");

  final nycNow = romeNow.cloneToTimezone('America/New_York');
  print("New York now: ${nycNow.format('YYYY-MM-DD HH:mm')}");

  final parsed = DateTz.parse(
    '2024-05-01 12:30',
    'YYYY-MM-DD HH:mm',
    'Europe/Rome',
  );
  print('Parsed date: ${parsed.format()}');
}
0
likes
160
points
0
downloads

Publisher

verified publisherlbdsh.com

Weekly Downloads

Port of the DateTz timezone utility for Flutter and Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

ISC (license)

Dependencies

intl, timezone

More

Packages that depend on mobile_date_tz