get_time_ago 0.0.6 icon indicating copy to clipboard operation
get_time_ago: ^0.0.6 copied to clipboard

A new Flutter package to format DateTime in seconds ago, minutes ago, hours ago, days ago and date.

GetTimeAgo #

A new Flutter package to format DateTime in seconds ago, minutes ago, hours ago, days ago and date.

pub package

Usage #

import 'package:get_time_ago/get_time_ago.dart';
var _dateTime = DateTime.now();

var result = TimeAgo.getTimeAgo(_dateTime);
print(result);

If you have saved DateTime as string in database, then you can parse it as:

import 'package:get_time_ago/get_time_ago.dart';
// You can save and fetch string type datetime as given format 
// from any backend databases and set it to a variable, 
// then parse this timestamp as given below steps:
var _timestamp = '2020-09-10 05:21:37.712498'; // String DateTime from backend.

var result = TimeAgo.getTimeAgo(DateTime.parse(_timestamp));
print(result);

Output #

32
likes
90
pub points
88%
popularity

Publisher

shield icon for verified publishersnixlab.co.in

A new Flutter package to format DateTime in seconds ago, minutes ago, hours ago, days ago and date.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, intl

More

Packages that depend on get_time_ago