Given a specific DateTime
value, how do I display relative time, like:
You can reduce the server-side load by performing this logic client-side. View source on some Digg pages for reference. They have the server emit an epoch time value that gets processed by Javascript. This way you don't need to manage the end user's time zone. The new server-side code would be something like:
public string GetRelativeTime(DateTime timeStamp)
{
return string.Format("", timeStamp.ToFileTimeUtc());
}
You could even add a NOSCRIPT block there and just perform a ToString().