public static DateTime FromSortableIntDateTime(this long sortableDateTime, DateTimeKind dtKind = DateTimeKind.Unspecified)
{
const byte digitsInDateOnly = 4 + 2 + 2;
byte totalDigits = (byte)((int)Math.Log10(sortableDateTime) + 1);
byte timePartDigits = (byte)(totalDigits - digitsInDateOnly);
int timePartOrder = (int)10.Pow(timePartDigits);
int sortableDate = (int)(sortableDateTime/timePartOrder); // YYYYMMDD
int day = sortableDate%100;
sortableDate /= 100;
int month = sortableDate%100;
sortableDate /= 100;
int year = sortableDate;
DateTime dt = new DateTime(year, month, day, 0, 0, 0, dtKind);
long sortableTimePart = sortableDateTime%timePartOrder; // 0, YYYYMMDDHHmmss, or YYYYMMDDHHmmssFFF
if(sortableTimePart > 0)
dt = sortableTimePart.FromSortableIntTime(dt);
return dt;
}