timeAgo method

String timeAgo()

Implementation

String timeAgo() {
  if (BZObjectUtil.isEmpty(this)) {
    return '';
  }
  final dateTime = (toString().length == 13)
      ? DateTime.fromMillisecondsSinceEpoch(toInt())
      : DateTime.fromMillisecondsSinceEpoch(toInt() * 1000);
  return dateTime.timeAgo();
}