Question

I've been trying to decode this binary date format for a while now, but considering I've never done that sort of thing before, I'm having a little bit of trouble. I know which bytes represent the date and I know what each output is supposed to be, but I'm still derpin' pretty hard here.

 Unsigned 8bit Int -       Result
----------------------------------------
                   - YYYY-MM-DD hh:mm:ss
65 208 247 254 128 - 2014-02-01 00:00:00
65 208 247 254 143 - 2014-02-01 00:01:00
65 208 247 254 158 - 2014-02-01 00:02:00
65 208 247 254 173 - 2014-02-01 00:03:00
65 208 247 254 188 - 2014-02-01 00:04:00
65 208 247 254 203 - ...
65 208 247 254 218
65 208 247 254 233
65 208 247 254 248
65 208 247 255 7
65 208 247 255 22
65 208 247 255 37
65 208 247 255 52
65 208 247 255 67
65 208 247 255 82
65 208 247 255 97
65 208 247 255 112
65 208 247 255 127
65 208 247 255 142
65 208 247 255 157
65 208 247 255 172
65 208 247 255 187
65 208 247 255 202
65 208 247 255 217
65 208 247 255 232
65 208 247 255 247
65 208 248 0 6
65 208 248 0 21
65 208 248 0 36
65 208 248 0 51
65 208 248 0 66
65 208 248 0 81
65 208 248 0 96
65 208 248 0 111
65 208 248 0 126
65 208 248 0 141
65 208 248 0 156
65 208 248 0 171
65 208 248 0 186
65 208 248 0 201
65 208 248 0 216
65 208 248 0 231
65 208 248 0 246
65 208 248 1 5
65 208 248 1 20
65 208 248 1 35
65 208 248 1 50
65 208 248 1 65
65 208 248 1 80
65 208 248 1 95
65 208 248 1 110
65 208 248 1 125
65 208 248 1 140
65 208 248 1 155
65 208 248 1 170
65 208 248 1 185
65 208 248 1 200
65 208 248 1 215
65 208 248 1 230
65 208 248 1 245
65 208 248 2 4
65 208 248 2 19
65 208 248 2 34
65 208 248 2 49
65 208 248 2 64
65 208 248 2 79
65 208 248 2 94
65 208 248 2 109
65 208 248 2 124
65 208 248 2 139
65 208 248 2 154
65 208 248 2 169
65 208 248 2 184
65 208 248 2 199
65 208 248 2 214
65 208 248 2 229
65 208 248 2 244
65 208 248 3 3
65 208 248 3 18
65 208 248 3 33
65 208 248 3 48
65 208 248 3 63
65 208 248 3 78
65 208 248 3 93
65 208 248 3 108
65 208 248 3 123
65 208 248 3 138
65 208 248 3 153
65 208 248 3 168
65 208 248 3 183
65 208 248 3 198
65 208 248 3 213
65 208 248 3 228
65 208 248 3 243
65 208 248 4 2
65 208 248 4 17
65 208 248 4 32
65 208 248 4 47
65 208 248 4 62
65 208 248 4 77

I actually reversed these bytes. They were originally stored in order of least significance first (that-is, seconds first), but I wanted to make it match the output a little more so I reversed the order. Also, there are always 3 trailing 0's (or leading if it weren't reversed). Since I know the data stores the date in 1 minute increments, I ommitted these 0's. I'm assuming that at least ONE of the zeros represents seconds. It may be that another 0 represents milliseconds because the data that corresponds to the dates in question are separated by 1/2 seconds. However, since its clumped in 1 minute increments (120 data points), I'm not sure it really matters. I just use 000 as a stop signal for each minute.

That being said, here is the original data un-touched along with the aforementioned 0's:

0 0 0 128 254 247 208 65
0 0 0 143 254 247 208 65
0 0 0 158 254 247 208 65
0 0 0 173 254 247 208 65
0 0 0 188 254 247 208 65
0 0 0 203 254 247 208 65
0 0 0 218 254 247 208 65
0 0 0 233 254 247 208 65
0 0 0 248 254 247 208 65
0 0 0 7 255 247 208 65
0 0 0 22 255 247 208 65
0 0 0 37 255 247 208 65
0 0 0 52 255 247 208 65
0 0 0 67 255 247 208 65
0 0 0 82 255 247 208 65
0 0 0 97 255 247 208 65
0 0 0 112 255 247 208 65
0 0 0 127 255 247 208 65
0 0 0 142 255 247 208 65
0 0 0 157 255 247 208 65
0 0 0 172 255 247 208 65
0 0 0 187 255 247 208 65
0 0 0 202 255 247 208 65
0 0 0 217 255 247 208 65
0 0 0 232 255 247 208 65
0 0 0 247 255 247 208 65
0 0 0 6 0 248 208 65
0 0 0 21 0 248 208 65
0 0 0 36 0 248 208 65
0 0 0 51 0 248 208 65
0 0 0 66 0 248 208 65
0 0 0 81 0 248 208 65
0 0 0 96 0 248 208 65
0 0 0 111 0 248 208 65
0 0 0 126 0 248 208 65
0 0 0 141 0 248 208 65
0 0 0 156 0 248 208 65
0 0 0 171 0 248 208 65
0 0 0 186 0 248 208 65
0 0 0 201 0 248 208 65
0 0 0 216 0 248 208 65
0 0 0 231 0 248 208 65
0 0 0 246 0 248 208 65
0 0 0 5 1 248 208 65
0 0 0 20 1 248 208 65
0 0 0 35 1 248 208 65
0 0 0 50 1 248 208 65
0 0 0 65 1 248 208 65
0 0 0 80 1 248 208 65
0 0 0 95 1 248 208 65
0 0 0 110 1 248 208 65
0 0 0 125 1 248 208 65
0 0 0 140 1 248 208 65
0 0 0 155 1 248 208 65
0 0 0 170 1 248 208 65
0 0 0 185 1 248 208 65
0 0 0 200 1 248 208 65
0 0 0 215 1 248 208 65
0 0 0 230 1 248 208 65
0 0 0 245 1 248 208 65
0 0 0 4 2 248 208 65
0 0 0 19 2 248 208 65
0 0 0 34 2 248 208 65
0 0 0 49 2 248 208 65
0 0 0 64 2 248 208 65
0 0 0 79 2 248 208 65
0 0 0 94 2 248 208 65
0 0 0 109 2 248 208 65
0 0 0 124 2 248 208 65
0 0 0 139 2 248 208 65
0 0 0 154 2 248 208 65
0 0 0 169 2 248 208 65
0 0 0 184 2 248 208 65
0 0 0 199 2 248 208 65
0 0 0 214 2 248 208 65
0 0 0 229 2 248 208 65
0 0 0 244 2 248 208 65
0 0 0 3 3 248 208 65
0 0 0 18 3 248 208 65
0 0 0 33 3 248 208 65
0 0 0 48 3 248 208 65
0 0 0 63 3 248 208 65
0 0 0 78 3 248 208 65
0 0 0 93 3 248 208 65
0 0 0 108 3 248 208 65
0 0 0 123 3 248 208 65
0 0 0 138 3 248 208 65
0 0 0 153 3 248 208 65
0 0 0 168 3 248 208 65
0 0 0 183 3 248 208 65
0 0 0 198 3 248 208 65
0 0 0 213 3 248 208 65
0 0 0 228 3 248 208 65
0 0 0 243 3 248 208 65
0 0 0 2 4 248 208 65
0 0 0 17 4 248 208 65
0 0 0 32 4 248 208 65
0 0 0 47 4 248 208 65
0 0 0 62 4 248 208 65
0 0 0 77 4 248 208 65

It doesn't seem like each byte is representing its own time units (like, seconds, minutes) because then I would expect some consistency (i.e. 0 minutes would always be the same value). So I'm assuming they're all supposed to be taken as a whole. Most certainly a "seconds from some date" format. I just don't really know what to do with this.

I feel like this is going to be pretty darn simple considering I see a pattern. Any thoughts on paths I should take to figure this thing out?

No correct solution

OTHER TIPS

Depending on where the time value came from it is probably Unix time, that is, the time in seconds since January 1, 1970. Most platforms have libraries to convert that to human readable time, there is no encoding of the actual time or date in the binary-- it is literally a counter.

Read more here:

http://en.wikipedia.org/wiki/Unix_time

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top