Skip to main content

TimeAgoPipe

Converts a date into the format "3 minutes ago", "5 hours ago" etc.

Example

HTML
{{ order.orderPlacedAt | timeAgo }}
Signature
class TimeAgoPipe implements PipeTransform {    constructor(i18nService: I18nService)    transform(value: string | Date, nowVal?: string | Date) => string;}
  • Implements: PipeTransform

constructor

method(i18nService: I18nService) => TimeAgoPipe

transform

method(value: string | Date, nowVal?: string | Date) => string
Was this chapter helpful?
Report Issue
Edited Feb 2, 2026·Edit this page