CSharp examples for System:DateTime Format
To Relative Time Micro
using System;//from w w w .j a va 2 s .c o m public class Main{ public static string ToRelativeTimeMicro(this DateTime dt) { var ts = new TimeSpan(DateTime.UtcNow.Ticks - dt.Ticks); if (ts.Days <= 330) { return dt.ToString("MMM %d").ToLower(); } else { return dt.ToString("MMM %d yy").ToLower(); } } }