Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display time padded how Stackoverflow and Facebook do - C#

I have a ASP.NET MVC 2 app I am building and users are allowed to post data in certain sections. I would like to display the "Posted At" in the same format that Stackoverflow and Facebook do.

i.e. On this site when I post this question it will display "asked 3 seconds ago" then "asked 3 mins ago" and after a few day it will display the date.

My app is C#, if anyone can point me in the right direction on the best way to accomplish this that would be great!

like image 882
Paul Avatar asked Jan 22 '23 11:01

Paul


1 Answers

Have a look at the jQuery plugin, timeago. I'm using it on a site that I'm building and it works great.

like image 126
Drew Noakes Avatar answered Jan 28 '23 08:01

Drew Noakes