Category Archives: Extensions

How to convert normal date time to relative

How to make a normal date like “12/05/2011” to “Some days some hours and some seconds ago”
Here is the answer. We have seen dates in vairous formats, some of you may noticed in facebook or orkut, how they show times. They show relative date and time.
Here is the code for doing it. It is an extension to DateTime Object.

And you are done!. Now you can use the code like this

Cheers