Skip to content
pubscout

time_machine

0.9.17, released 5 years ago by an unverified publisher

Date and time library with support for timezones, calendars, cultures, formatting and parsing.

WASM-ready
$ flutter pub add time_machine
Source repository

What it does

Time Machine provides an alternative date and time API over Dart Core with support for timezones, calendars, cultures, formatting, and parsing. It is a port of Noda Time designed for Flutter, Web, and Server.

AI-written summary of version 0.9.17, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need robust timezone and calendar calculations.
  • You require culture-aware date and time formatting and parsing.

Skip it when

  • You only need basic, localized-free DateTime operations provided by dart:core.

Strengths

  • Consistency across platforms including Web, Flutter, and Server
  • Comprehensive timezone and calendar system support

Weaknesses

  • Requires manual asset configuration for timezones and cultures in Flutter
  • Preview status with some ongoing API stabilization

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
2

Requires adding TZDB and culture binary assets to pubspec.yaml for Flutter and calling TimeMachine.initialize().

await TimeMachine.initialize();
var now = Instant.now();
print('UTC Time: $now');
print('Local Time: ${now.inLocalZone()}');

Alternatives

Packages that do the same job and could replace time_machine.

  • time_machine2

    Comprehensive date and time library with support for timezones, calendars, cultures, and parsing.

  • jiffy

    Parse, manipulate, query, and format dates and times in Dart and Flutter.

  • money2

    High-precision library for storing, parsing, formatting, and performing arithmetic on money.

  • sugar

    Standard library extension for date-times, timezones, collections, and monads.