zoned_date 1.0.0

  • Example
  • Installing
  • Versions
  • 59


DateTime with timezones.



Interpret DateTime as different zone

Interpret year, month, day, hour, minute, second, millisecond and microsecond with different time zone.

// Interpret 2018.1.14T17:32 in EST timezone
final time = new ZonedDate.asZone(new DateTime(2018, 1, 14, 17, 32), Timezone.est);

Convert to different zone

// Convert local current time to EST
final time = new ZonedDate.convertZone(new, Timezone.est);

Current time at different timezone

// Convert local current time to EST
final time = new ZonedDate(Timezone.est);



  • ZonedDate


import 'package:zoned_date/zoned_date.dart';

main() {
  print(new ZonedDate.convertZone(new, Timezone.est));
  print(new ZonedDate(Timezone.est));
  print(new ZonedDate());

  final time = new ZonedDate.make(2018,
      month: 1, day: 14, hour: 1, minute: 15, zone: Timezone.est);
  print(time.add(new Duration(hours: 1)));

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  zoned_date: "^1.0.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:zoned_date/zoned_date.dart';
Version Uploaded Documentation Archive
1.0.0 Jan 14, 2018 Go to the documentation of zoned_date 1.0.0 Download zoned_date 1.0.0 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
20 / 100
Code health derived from static analysis. [more]
98 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:zoned_date/zoned_date.dart.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Strong-mode analysis of lib/src/time_zone.dart gave the following hint:

    line: 10 col: 17
    Always override hashCode if overriding ==.

    Strong-mode analysis of lib/src/zoned_date_base.dart gave the following hint:

    line: 24 col: 5
    Dead code.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
date_format ^1.0.2 1.0.4
Dev dependencies
test ^0.12.0