Skip to main content

Time Ago

Archive 2014

A PHP function that renders timestamps as relative time — “5 minutes ago”, Facebook style.

PHP

Why it exists

A single PHP function that converts the difference between two dates into a human-readable string: seconds ago, minutes ago, hours ago, weeks ago, and so on.

What I learned

Small by design — the kind of utility you write once, publish, and keep reusing across projects. A reminder that not every useful piece of software needs to be a system.

Status

Archived. Native to most languages now, but the function itself is still around for anyone who wants a small dependency-free option.