UTILITY

ago()

Format a timestamp as relative time.

Signature

string ago(string|int|DateTimeInterface $time, ?DateTimeInterface $now = null)

Example

ago(time() - 3600); // '1 hour ago'

Available from: 1.5.0

Reference navigation

Previous: age()

Next: before()

Back to utilities