Q:

6 bytes timestamp to DateTime

I use 3rd party API.  According to its specification the following 
  byte[] timestamp = new byte[] {185, 253, 177, 161, 51, 1}

represents Number of milliseconds from Jan 1, 1970 when the message 
was generated for transmission 
The issue is that I don't know how it could be translated into DateTime. 
I've tried 
DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind. Utc);
long milliseconds = BitConverter. ToUInt32(timestamp, 0);
var result =  Epoch + TimeSpan. FromMilliseconds(milliseconds);

The result is  {2/1/1970 12:00:00 AM}, but year 2012 is expected. 

A:

        byte[] timestamp = new byte[] { 185, 253, 177, 161, 51, 1, 0, 0, };
        DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind. Utc);
        ulong milliseconds = BitConverter. ToUInt64(timestamp, 0);
        var result = Epoch + TimeSpan. FromMilliseconds(milliseconds);

Result is 11/14/2011
Adding padding code special for CodeInChaos:
    byte[] oldStamp = new byte[] { 185, 253, 177, 161, 51, 1 };
    byte[] newStamp = new byte[sizeof(UInt64)];
    Array. Copy(oldStamp, newStamp, oldStamp. Length);

For running on big-endian machines :
if (! BitConverter. IsLittleEndian)
{
    newStamp = newStamp. Reverse().ToArray();
}

A:

I assume timestamp uses little endian format.  I also left out parameter validation. 
long GetLongLE(byte[] buffer,int startIndex,int count)
{
  long result=0;
  long multiplier=1;
  for(int i=0;i<count;i++)
  {
    result += buffer[startIndex+i]*multiplier;
    multiplier *= 256;
  }
  return result;
}

long milliseconds = GetLongLE(timestamp, 0, 6);

