Pretty Date (Facebook/Twitter style) - X Month(s)/Week(s)/Day(s)/Hour(s)/Minute(s)/Second(s) ago


/ Published in: C#
Save to your folder(s)

A simple C# function to take a standard DateTime and convert it to a pretty string saying how many seconds/minutes/days/weeks/months ago the date was, it doesn't return an actual date, but that wouldn't be hard to change the month/week/day section to return a formatted date instead of the string currently returned.

URL: prettydate

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.