I'm attempting to parse a file that has a time stamp that i believe is 8 bytes long and looks like so in hex
00 00 00 00 DE A4 4F 4F
I do not receive the correct date/time when i parse this as an Int64. However if i skip the first 4 bytes and do something like so i get the correct datetime.
TimeSpan span = TimeSpan.FromTicks(BitConverter.ToInt32(bytes.Skip(index).Take(8).ToArray(),4) * TimeSpan.TicksPerSecond);
DateTime t = new DateTime(1970, 1, 1).Add(span);
StartTime = TimeZone.CurrentTimeZone.ToLocalTime(t);
However I'm not certain the next files i get to parse are going to have leading 00's for the first 4 bytes. If i parse this as a ToInt64 i throw an outOfRange exception. What is the proper way to parse this?