I have a stand alone java application that receives SNMP messages via an SNMP trap. I am using SNMP4J library in my application. In the SNMP message received, I need to convert the event time field, which is in hexadecimal format, into a human readable format. The event time field received normally looks as follows for example:
eventTime*SNMPv2-SMI::enterprises.193.183.4.1.4.5.1.7.0 = Hex-STRING:
07 DC 03 0C 12 15 2C 1F 2B 01 00
Can anyone tell me how I can convert the text '07 DC 03 0C 12 15 2C 1F 2B 01 00' into a human readable datetime value with or without the help of SNMP4J library? Thanks.
you can use Integer.parseInt("07dc", 16) and out 2012 pops, so this should give a hint of the year, the rest i'm sure you will figure out by yourself if this is indeed the year.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With