This is actually a better solution I've found. Uses jQuery however it works perfectly. Also it refreshes automatically similar to the way SO and Facebook does so you don't have to refresh the page to see the updates.
This plugin will read your datetime
attr in the
tag and fill it in for you.
e.g. "4 minutes ago" or "about 1 day ago
http://timeago.yarp.com/