Hi,

 

I used makeDateAndTime
<http://www.snmp4j.org/agent/doc/org/snmp4j/agent/mo/snmp/DateAndTime.ht
ml#makeDateAndTime%28java.util.GregorianCalendar%29>
(java.util.GregorianCalendar dateAndTime) to get an OctetString.

 

A sample OctetString for a Date ("11-Aug-10 13:46") in IST TimeZone is
calculated as "07:da:08:0b:0d:2e:00:00:2b:05:40" while it really should
have been "07:da:08:0b:0d:2e:00:00:2b:05:1e", because "2b:05:40" results
in "+5.64" while "2b:05:1e" results in "+5.30"(valid one).

 

The makeDateAndTime method should replace the following line

os.append((byte)(tz.getOffset(dateAndTime.getTimeInMillis())%3600000));

with

os.append((byte)((tz.getOffset(dateAndTime.getTimeInMillis())%3600000)/6
0000)); 

 

 

Request you to fix this part of the code.

 

Thanks & Regards,

 Amarnath Chatterjee

_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to