Convert date & time to relative time string

Programming No Comments »

I recently used this feature in a couple different applications on various platforms.

Take this:

2008-10-13 17:47:33

and turn it into this:

5 minutes 16 seconds ago

Please share links to code snippets for any other languages in the comments!

For C# / .NET

For PHP

Javascript trick to make web pages editable in your browser

Programming No Comments »

Just paste the following code into the address bar of your browser on a webpage that you’d like to edit:

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

This will make the current page editable. This is good for spoofing information on a site that you want to share with others, like say affiliate revenues.

This works in both Internet Explorer & Firefox.

Design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in