get_time_ago 0.0.3 get_time_ago: ^0.0.3 copied to clipboard
A new Flutter package for getting time formats in secons, minutes, hours, days and date.
A new Flutter package for getting time formats in seconds, minutes, hours, days and date.
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';
var dateTime = timestamp; // String DateTime from backend.
var result = TimeAgo.getTimeAgo(DateTime.parse(timestamp));
print(result);