public static ToSortableLongTime ( this dt, bool includeMilliseconds = false ) : long | ||
dt | this | |
includeMilliseconds | bool | |
return | long |
public static long ToSortableLongTime(this DateTime dt, bool includeMilliseconds = false)
{
long retVal = (dt.Hour*100 + dt.Minute)*100 + dt.Second;
if(includeMilliseconds)
retVal = retVal*1000 + dt.Millisecond;
return retVal;
}