简体   繁体   中英

Datetime unknown binary format

I have the following array of bytes:

Byte[] date = { 0x00, 0xf1, 0x04, 0x80, 0x0f, 0xca, 0xa8, 0x62 };

Unfortunately i have no idea how to convert it to a DateTime type.

The only hint that i have is that the "date" part is 10/24/2015 (mm/dd/yyyy), the "time" part exist, but i don't know.

I'm already tried the conversions:

var firstAttempt = DateTime.FromBinary(0x00f104800fcaa862);
var secondAttempt = DateTime.FromFileTime(0x00f104800fcaa862);
var thirdAttempt = DateTime.FromFileTimeUtc(0x00f104800fcaa862);
var fourthAttempt = DateTime.FromOADate(0x00f104800fcaa862);
var fifthAttempt = new DateTime(0x00f104800fcaa862);

But with no success.

someone could help me?

Thanks.

Are you sure that your binary representation of the date is correct? It looks like 10/24/2015 should look like 0x8D2DC060F768000 .

If your Input is correct and it is a different kind of a binary converter - you'll need your own parser. Or some kind of modification of the data source (so it could return string representation for instance)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM