HOME

com.ireasoning.protocol.snmp
Class SnmpDateAndTime

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.SnmpOctetString
      extended bycom.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

Field Summary
 
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
 
Constructor Summary
SnmpDateAndTime(byte[] date)
          Constructor
SnmpDateAndTime(Calendar date)
          Constructor
SnmpDateAndTime(String dateTime)
           
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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
Method Detail

toString

public String toString()
Returns String representation in a format like "1992-5-26,13:30:15.0,-4:0"

Overrides:
toString in class SnmpOctetString

main

public static void main(String[] args)

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.