Unleash the power of .Net

Monthly Archives: July 2014

I recently had a requirement in javascript to translate a date and time into something more friendly, so that for example 10th January 2014 10:45 becomes “Yesterday 10:45”, or 12:15 today becomes “2 hours ago”. After scanning the various solutions I could find, I came up with the following: