I always use something like the following:
public static String GetTimestamp(this DateTime value)
{
return value.ToString("yyyyMMddHHmmssfff");
}
This will give you a string like 200905211035131468, as the string goes from highest order bits of the timestamp to lowest order simple string sorting in your SQL queries can be used to order by date if you're sticking values in a database
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…