com.ireasoning.protocol.snmp
Class SnmpDateAndTime
java.lang.Object
   com.ireasoning.protocol.snmp.SnmpOctetString
com.ireasoning.protocol.snmp.SnmpOctetString
       com.ireasoning.protocol.snmp.SnmpDateAndTime
com.ireasoning.protocol.snmp.SnmpDateAndTime
- All Implemented Interfaces: 
- Msg, Serializable, SnmpDataType
- public class SnmpDateAndTime- extends SnmpOctetString
This class represents the DateAndTime data type as defined in SNMPV2-TC
 
    DateAndTime ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
    STATUS       current
    DESCRIPTION
            "A date-time specification.
            field  octets  contents                  range
            -----  ------  --------                  -----
              1      1-2   year*                     0..65536
              2       3    month                     1..12
              3       4    day                       1..31
              4       5    hour                      0..23
              5       6    minutes                   0..59
              6       7    seconds                   0..60
                           (use 60 for leap-second)
              7       8    deci-seconds              0..9
              8       9    direction from UTC        '+' / '-'
              9      10    hours from UTC*           0..13
             10      11    minutes from UTC          0..59
            * Notes:
            - the value of year is in network-byte order
            - daylight saving time in New Zealand is +13
            For example, Tuesday May 26, 1992 at 1:30:15 PM EDT would be
            displayed as:
                             1992-5-26,13:30:15.0,-4:0
            Note that if only local time is known, then timezone
            information (fields 8-10) is not present."
    SYNTAX       OCTET STRING (SIZE (8 | 11))
 
- See Also:
- Serialized Form
 
| Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType | 
| BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND | 
 
| Fields inherited from interface com.ireasoning.protocol.Msg | 
| ERROR_TYPE | 
 
 
| Method Summary | 
| static void | main(String[] args)
 | 
|  String | toString()Returns String representation in a format like "1992-5-26,13:30:15.0,-4:0"
 | 
 
| Methods inherited from class com.ireasoning.protocol.snmp.SnmpOctetString | 
| convertPhysAddress, copy, encode, equals, getBytes, getLength, getType, getTypeString, getValue, hashCode, setValue, toHexString, toPrintableString, toString, toString2 | 
 
 
SnmpDateAndTime
public SnmpDateAndTime(Calendar date)
- Constructor
 
- Parameters:
- date- a Calendar object used to contruct this object
SnmpDateAndTime
public SnmpDateAndTime(String dateTime)
- Parameters:
- dateTime- a string in format "2d-1d-1d,1d:1d:1d.1d".
 For example, Tuesday May 26, 1992 at 1:30:15 would be
            represented as:
                             92-5-26,13:30:15.0  or    1992-5-26,13:30:15.0
SnmpDateAndTime
public SnmpDateAndTime(byte[] date)
- Constructor
 
- Parameters:
- date- a DateAndTime byte array as defined in SNMPV2-TC
toString
public String toString()
- Returns String representation in a format like "1992-5-26,13:30:15.0,-4:0"
 
- 
- Overrides:
- toStringin class- SnmpOctetString
 
- 
 
main
public static void main(String[] args)
- 
 
Copyright © 2002 iReasoning Inc. All Rights Reserved.