Getting Started ✨
DateTime, and is immutable.
final now = Moment.now();
assert(now is DateTime); // true
assert(now is Moment); // true
In your project directory, run:
dart pub add moment_dart
# For flutter
flutter pub add moment_dart
or, manually add in
Import the package
You may want to set global localization at the initialization of your application.
Create a moment instance. See list of constructors
Moment moment = DateTime.now().toMoment();
Common problems you might face
DateTime, most functionality in moment_dart does not check, enforce,
or alter the timezone of date times. Altough, Some methods like
Moment.format() do offer options to enforce certain timezone.
You might want to skim through common mishaps.