Class ConfDatetime

All Implemented Interfaces:
Serializable, Cloneable, Comparable<ConfDatetime>

public class ConfDatetime extends ConfValue implements Cloneable, Serializable, Comparable<ConfDatetime>
DATA_CONTAINER - Corresponds to the YANG date-and-time type.
See Also:
  • Constructor Details

    • ConfDatetime

      public ConfDatetime(ConfEObject o) throws ConfException
      For internal usage.
      Throws:
      ConfException
    • ConfDatetime

      public ConfDatetime(int year, int month, int day, int hour, int min, int sec, int micro, int timezone, int timezone_minutes)
      Parameters:
      year - -
      month - - month from 1 to 12
      day - -
      hour - -
      min - -
      sec - -
      micro -
      timezone - - Timezone Hour in unit hours
      timezone_minutes - - Timezone Minutes in unit minutes
    • ConfDatetime

      public ConfDatetime(String str)
    • ConfDatetime

      @Deprecated public ConfDatetime()
      Deprecated.
      Do not use this constructor. It does not handle DST correctly
    • ConfDatetime

      @Deprecated public ConfDatetime(GregorianCalendar cal)
      Deprecated.
      Do not use this constructor. It does not handle DST correctly
      Parameters:
      cal -
  • Method Details

    • getConfDatetime

      public static ConfDatetime getConfDatetime()
      Returns:
      Returns the current time in UTC TimeZone.
    • getYear

      public int getYear()
    • getMonth

      public int getMonth()
    • getDay

      public int getDay()
    • getHour

      public int getHour()
    • getMin

      public int getMin()
    • getSec

      public int getSec()
    • getMicro

      public int getMicro()
    • getTimezone

      public int getTimezone()
      Returns:
      The Hour timezone in hours, for example 02:00 will return 2 hours
    • isTimezoneSet

      public boolean isTimezoneSet()
    • getTimezoneMinutes

      public int getTimezoneMinutes()
      Returns:
      The Minutes timezone in minutes, for example 02:30 will return 30 minutes
    • getCalendar

      @Deprecated public GregorianCalendar getCalendar()
      Deprecated.
      Do not use this method. It does not handle DST correctly
    • before

      @Deprecated public boolean before(ConfDatetime time)
      Deprecated.
      Do not use this method. It does not handle DST correctly For comparison of ConfDatetime object.
    • after

      @Deprecated public boolean after(ConfDatetime time)
      Deprecated.
      Do not use this method. It does not handle DST correctly For comparison of ConfDatetime object.
    • equals

      public boolean equals(Object o)
      Description copied from class: ConfValue
      Determine if two ConfValue are equal. In general, ConfObjects are equal if the components they consist of are equal.
      Specified by:
      equals in class ConfValue
      Parameters:
      o - The object to compare to.
      Returns:
      true if the objects are identical.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class ConfValue
    • toString

      public String toString()
      Specified by:
      toString in class ConfValue
      Returns:
      the printable representation of the object.
    • encode

      public ConfEObject encode()
      Description copied from class: ConfValue
      encode value.
      Specified by:
      encode in class ConfValue
    • compareTo

      @Deprecated public int compareTo(ConfDatetime o)
      Deprecated.
      Do not use this method. It does not handle DST correctly
      Specified by:
      compareTo in interface Comparable<ConfDatetime>