time_ago_provider 1.0.0 copy "time_ago_provider: ^1.0.0" to clipboard
time_ago_provider: ^1.0.0 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. e.g("7 minutes ago" ).

example/time_ago_provider_example.dart

import 'package:time_ago_provider/time_ago_provider.dart';

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

  //With Language DEFAULT = English.
  int germanTimeStamp = DateTime.now().millisecondsSinceEpoch;
  String germanTimeAgo = TimeAgo.getTimeAgo(germanTimeStamp, language: Language.GERMAN);
  print("Gepostet $germanTimeAgo");
}
32
likes
0
pub points
87%
popularity

Publisher

unverified uploader

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. e.g("7 minutes ago" ).

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on time_ago_provider