[SNMP4J] date to timeticks

Frank Fock fock at agentpp.com
Thu Aug 31 09:24:36 CEST 2006


Hello Jose,

TimeTicks is not the appropriate syntax for a date
value. Instead I would recommend using the DateAndTime
TC. SNMP4J-Agent has a class with convenience methods
to convert to/from a date.

Best regards,
Frank

Jose Ignacio wrote:
> Hello, I'm trying this:
> 
> Date d = new Date();
> TimeTicks tt = new TimeTicks(d.getTime());
> 
> also i've tried
> 
> Date d = new Date();
> TimeTicks tt = new TimeTicks();
> tt.fromMilliseconds(d.getTime());
> 
> 
> and it return:
> 
> java.lang.IllegalArgumentException: Argument must be an unsigned 32bit 
> value
>    at org.snmp4j.smi.UnsignedInteger32.setValue(UnsignedInteger32.java:148)
>    at org.snmp4j.smi.TimeTicks.fromMilliseconds(TimeTicks.java:151)
>    at testPackage.snmpTest(snmpTest.java:22)
> 
> it's because currentTime is bigger than 4294967295l
> 
> What I've to do to send a date?
> 
> Thanks.
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list