How to get a pretty date in c#

added by joancaron47
2/16/2013 9:55:55 PM

2 Kicks, 64 Views

Have you ever wondered how some sites were able to show the bottom of each post, a formatted date (pretty date) which estimates the number of days, months or years between the publication of the post and today? e.g. "posted 5 weeks ago" This snippet will allow you to do this easily! You can improve this code by adding, for example, a dictionary of resources for the different languages ​​of your application or website.