[SNMP4J] Convert long to int?

Frank Fock fock at agentpp.com
Tue Jun 5 00:23:33 CEST 2007


Hi Joel,

As the name "TimeTicks" suggests, this type is NOT
designed to hold a time value. To hold a time
value, use the DateAndTime textual convention.

Best regards,
Frank

Joel Goguen wrote:
> I'm having some trouble creating a TimeTicks object.  The constructor
> says to pass a long value, which I'm doing by calling
> System.currentTimeMillis(), which is required since the device
> receiving my traps displays the TimeTicks field as the current system
> time.  However, when I pass this long value to TimeTicks, I get an
> IllegalArgumentException, since the current system time is greater
> than 2^32 - 1.  Is there any way to convert a long to fit into
> TimeTicks that would preserve the current system time?
> 

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




More information about the SNMP4J mailing list