Java中人类可读格式的SNMP EventTime

编程入门 行业动态 更新时间:2024-10-26 21:24:01
本文介绍了Java中人类可读格式的SNMP EventTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个独立的Java应用程序,它通过SNMP陷阱接收SNMP消息.我在我的应用程序中使用SNMP4J库.在收到的SNMP消息中,我需要将十六进制格式的事件时间字段转换为人类可读的格式.通常收到的事件时间字段如下所示:

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

有人能告诉我如何借助或不借助SNMP4J库将文本'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.

推荐答案

您可以使用Integer.parseInt("07dc",16)并弹出2012年流行音乐,因此这应该给您一些暗示,剩下的就是确保您会自己弄清楚这是否确实是这一年.

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.

更多推荐

Java中人类可读格式的SNMP EventTime

本文发布于:2023-11-11 06:35:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577649.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可读   人类   格式   Java   SNMP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!