Contextual user-friendly time and dates with PHP

In building this issue tracker for work, I decided that having 26 Mar 2008 5:33pm was not going to fly.

Taking some inspiration from 37signals and their contextual dates, I built this easy-to-use-yet-encompassing function.

It is yours for the taking, Internet.

updated 5/7: I made a few tweaks to remove occurrences like ‘0 seconds ago’, ‘1 seconds ago’, ‘about 23 hours ago’, etc.

Now you’ll get about 35 minutes ago, yesterday, or even about 2 years ago.

If you enjoyed this post, then tweet about it!