time_ago_provider 0.1.1 copy "time_ago_provider: ^0.1.1" to clipboard
time_ago_provider: ^0.1.1 copied to clipboard

outdated

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present (Now). (e.g. "7 minutes ago" ).

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present (Now). (e.g. "7 minutes ago" ).

Usage #

Easy Lazy! Feed her timestamp, produces you time ago.

import 'package:time_ago_provider/time_ago_provider.dart';

void main()
{
  //Normal Usage
  int myTimeStamp = DateTime.now().millisecondsSinceEpoch; // Get the current time stamp
  String timeAgo = TimeAgo.getTimeAgo(timeStamp: myTimeStamp); //getTimeAgo(int timeStamp) returns a String " X minutes/hours/days/months/years ago ..."
  print("Posted $timeAgo");

  //With Language
  int mySecondTimeStamp = DateTime.now().millisecondsSinceEpoch;
  String germanTimeAgo = TimeAgo.getTimeAgo(timeStamp: mySecondTimeStamp, language: Language.GERMAN); //Default Language ENGLISH
  print("Gepostet $germanTimeAgo");
}

Methods #

Function Parameter Description Return
getTimeAgo int timeStamp Returns an interval String of the time that passed between the given time stamp to the present (Now) String timeAgo

Supported Languages #

  • ✅ ENGLISH
  • ✅ ARABIC
  • ✅ GERMAN
  • ✅ SPANISH
  • ✅ CHINESE
  • ✅ RUSSIAN
  • ✅ PORTUGUESE
  • ✅ JAPANESE
  • ✅ HINDI
  • ✅ FRENCH

Features and bugs #

Please file feature requests and bugs at the issue tracker.

33
likes
40
points
356
downloads

Publisher

unverified uploader

Weekly Downloads

A Library that takes a time stamp value and returns an interval String of the time that passed between the given time stamp to the present (Now). (e.g. "7 minutes ago" ).

Repository (GitHub)

License

MIT (license)

More

Packages that depend on time_ago_provider