timeAgo method

String timeAgo()

Returns a human-readable relative time string

Example:

final twoHoursAgo = DateTime.now().subtract(Duration(hours: 2));
print(twoHoursAgo.timeAgo()); // "2 hours ago"

Implementation

String timeAgo() => QDateTimeUtils.toRelativeTime(this);