Skip to content
pubscout

jiffy

6.4.5, released 6 months ago by an unverified publisher

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

WASM-ready
$ flutter pub add jiffy
Source repository

What it does

Jiffy is a date time package for Flutter and Dart that simplifies parsing strings, lists, or maps into dates, manipulating them through additions or subtractions, querying relationships like 'isBefore' or 'isBetween', and formatting with custom patterns or relative time strings.

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

Use it when

  • You need complex date calculations and time manipulation in your app
  • You require relative time formatting like '5 years ago' or 'in 25 years
  • You want easy localized date formatting across multiple languages

Skip it when

  • You only need basic DateTime operations provided natively by Dart
  • You want a reactive or stream-based clock library

Strengths

  • Extensive formatting options and pre-set formats
  • Robust relative time calculations (from/to now)
  • Built-in localization support for multiple locales

Weaknesses

  • Adds an external dependency for features overlapping with the standard library
  • Requires asynchronous loading/setting for non-default locales

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Simply add jiffy to your pubspec.yaml dependencies and import it.

import 'package:jiffy/jiffy.dart';

void main() {
  var formattedDate = Jiffy.now().format(pattern: 'MMMM do yyyy, h:mm:ss a');
  print(formattedDate);
}

Alternatives

Packages that do the same job and could replace jiffy.

  • html

    A Dart implementation of an HTML5 parser for strings and bytes.

  • xml

    Full-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.

  • money2

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

  • time_machine2

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

Works with

Packages commonly used together with jiffy: ones it builds on, ones built on it, and its own family.