TimeSpan ts = DateTime.Now - dt;
if (ts.TotalMinutes < 1)
return "1分钟";
else if (ts.TotalMinutes < 60)
return (ts.Minutes + 1) + "分钟";
else if (ts.TotalMinutes > 60 && ts.TotalHours <= 24)
return ts.Hours + "小时";
else if (ts.TotalHours > 24 && ts.TotalDays <= 7)
return ts.Days + "天";
else if (ts.TotalDays > 7 && ts.TotalDays <= 31)
return ts.Days / 7 + "周";
else if (ts.TotalDays > 31 && ts.TotalDays <= 365)
return ts.Days / 30 + "个月";
else if (ts.TotalDays > 365 && ts.TotalDays < 10000)
return ts.Days / 365 + "年";
else
return ts.Days + "天";
...楼上连源码都给你贴出来了...