Skidoosh

Skidoosh – PHP, Python, Django, Ruby on Rails Web Developer in North Wales

Category: Snippets

Create Twitter like date formatted strings with PHP

A small function to produce Twitter like dates from various date formats. Just feed it a date, it converts it to a time (a unix timestamp), works out the difference and returns a “nice” formatted date i.e. About 1 week ago. Hope this helps.