I got a class with some time utility methods. Now I need to add to that a method the does the following:
public static string LastUpdated(DateTime date)
{
string result = string.Empty;
//check if date is sometime "today" and display it in the form "today, 2 PM"
result = "today, " + date.ToString("t");
//check if date is sometime "yesterday" and display it in the form "yesterday, 10 AM"
result = "yesterday, " + date.ToString("t");
//check if the day is before yesterday and display it in the form "2 days ago"
result = ... etc;
return result;
}
Any ideas?