0

Can someone help me? I have a byte[2] with values:

byte[0] = 113
byte[1] = 66

How do I get a the date through the DOS date format from this 2 bytes?

4

1 回答 1

6

正如@HansPassant 所说...

byte[] bytes = new byte[] { 113, 66 };

var day = (bytes[0] >> 3);
var month = ((bytes[0] & 0x7) << 1) | (bytes[1] >> 7);
var year = (bytes[1] >> 1) + 1980;

会给你 2013/02/14

于 2013-03-17T22:08:17.380 回答