|
From: Jeremy L. <jla...@re...> - 2015-07-12 06:05:46
|
On 10 July 2015 at 19:10, Claessens Jurgen <Jur...@ce...>
wrote:
> That works for the year, but how would I get the entire date, time then?
> When I try to extend the range and try to unpack, line blow, it still only
> shows 2015.
>
You need to use SUBSTR to pick out the various bytes for each element, and
then use UNPACK to convert to a numeric that can be displayed. The "year"
example was just to show you how to do the first part. The rest was left
for you to explore.
> Maybe split the thing completely, but how do you define in this case where
> it starts?
>
The SUBSTR transform can be told where to start. So for example, start at
position 2 for the month, and only one byte:
hrSystemDateMonPacked: SUBSTR : {hrSystemDate} 2 1
hrSystemDateDayPacked: SUBSTR : {hrSystemDate} 3 1
Then you "simply" unpack into integers. I say "simply" because I don't
really know how to use unpack, and only guessed at the format character
required for the year. Because year is 2 bytes and month and day are each
1 byte, it's not the same unpack format character. I had a go at unpacking
the month and day-of-month, but I wasn't able to get it to unpack
correctly. Once you can crack the unpacking, should work for you.
J
|