| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I have a 56 byte array of data. Document says that position 31-33 is a date value stored as a 3-byte (Binary Date - big-endian format). The values in these three bytes are 0,159, and 204. I have tried everything I can think of with the encoding methods in .net Here is my line of code that returns garbage data back...definitely not a date value RecDate = Encoding.BigEndianUnicode.GetString(e.Datagram.Buf fer, 31, 3) Any help is appreciated. |
|
#2
| |||
| |||
| On Thu, 04 Sep 2008 11:06:51 -0700, sbenavides wrote: > RecDate = Encoding.BigEndianUnicode.GetString(e.Datagram.Buf fer, 31, 3) > Any help is appreciated. What gives you the idea that it is a string? I know SFA about your platform, but just reading the three bytes as a 24 bit big endian number gives me: 0 * 2^16 + 159 * 2^8 + 204 = 40908, which looks like september4th 08 to me. I would note the Y2 or 3K bug here. Regards, Dan. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.