Skip to content
pubscout

timeago

3.7.1, released 2 years ago by an unverified publisher

Humanize dates into fuzzy timestamps like "15 minutes ago"

WASM-readyQuiet but busy
$ flutter pub add timeago
Source repository

What it does

Provides a single format function that converts a DateTime into a human‑readable relative string. It ships with English and Spanish messages and allows adding or overriding locales via setLocaleMessages.

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

Use it when

  • You need a quick relative time display in a UI
  • You want to support multiple languages without pulling in a heavy i18n library
  • You prefer a small, dependency‑free package for date formatting

Skip it when

  • You need full locale‑aware date formatting with plural rules
  • You require complex calendar or timezone handling beyond simple relative strings

Strengths

  • Simple API – one function call
  • Extensible locale system – add custom messages
  • No runtime dependencies – lightweight

Weaknesses

  • Limited to relative time strings only
  • Only basic plural handling – not full i18n
  • Requires manual locale registration for additional languages

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Add to pubspec and import package: import 'package:timeago/timeago.dart' as timeago;

import 'package:timeago/timeago.dart' as timeago;

void main() {
  final fifteenAgo = DateTime.now().subtract(Duration(minutes: 15));
  print(timeago.format(fifteenAgo)); // 15 minutes ago
  print(timeago.format(fifteenAgo, locale: 'es')); // hace 15 minutos
}

Alternatives

Packages that do the same job and could replace timeago.

Works with

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