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.
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.
59Compare - jiffy
Parse, manipulate, query, and format dates and times in Dart and Flutter.
70Compare - money2
High-precision library for storing, parsing, formatting, and performing arithmetic on money.
89Compare - sugar
Standard library extension for date-times, timezones, collections, and monads.
68Compare