Class DatatypeCoder.RawDateTimeStruct

  • Enclosing interface:
    DatatypeCoder

    @Deprecated
    public static final class DatatypeCoder.RawDateTimeStruct
    extends java.lang.Object
    Deprecated.
    use a java.time type; will be removed in Jaybird 6
    Raw date/time value.

    Fractions are sub-second precision in 100 microseconds.

    We cannot simply pass millis to the database, because Firebird stores timestamp in format (citing Ann W. Harrison):

    "[timestamp is] stored a two long words, one representing the number of days since 17 Nov 1858 and one representing number of 100 nano-seconds since midnight" (NOTE: It is actually 100 microseconds!)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int day
      Deprecated.
       
      int fractions
      Deprecated.
       
      int hour
      Deprecated.
       
      int minute
      Deprecated.
       
      int month
      Deprecated.
       
      int second
      Deprecated.
       
      int year
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int getEncodedDate()
      Deprecated.
      Encodes the date as used by Firebird (Modified Julian Date, or number of days since 17 November 1858).
      int getEncodedTime()
      Deprecated.
      Encodes the time as used by Firebird (fractions (100 milliseconds) in a day).
      int getFractionsAsNanos()
      Deprecated.
       
      void setFractionsFromNanos​(long nanos)
      Deprecated.
      Sets the sub-second fraction (100 microseconds) from a nanosecond value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • year

        public int year
        Deprecated.
      • month

        public int month
        Deprecated.
      • day

        public int day
        Deprecated.
      • hour

        public int hour
        Deprecated.
      • minute

        public int minute
        Deprecated.
      • second

        public int second
        Deprecated.
      • fractions

        public int fractions
        Deprecated.
    • Constructor Detail

      • RawDateTimeStruct

        public RawDateTimeStruct()
        Deprecated.
      • RawDateTimeStruct

        public RawDateTimeStruct​(int encodedDate,
                                 boolean hasDate,
                                 int encodedTime,
                                 boolean hasTime)
        Deprecated.
        Initializes a raw date/time value from encoded time and/or date integers.
        Parameters:
        encodedDate - Encoded date (Modified Julian Date)
        hasDate - If date should be decoded (set false for a time-only value)
        encodedTime - Encoded time (fractions in day)
        hasTime - If time should be decoded (set false for a date-only value)
        Since:
        4.0
    • Method Detail

      • getFractionsAsNanos

        public int getFractionsAsNanos()
        Deprecated.
      • setFractionsFromNanos

        public void setFractionsFromNanos​(long nanos)
        Deprecated.
        Sets the sub-second fraction (100 microseconds) from a nanosecond value.
        Parameters:
        nanos - Sub-second nanoseconds
        Since:
        4.0
      • getEncodedDate

        public int getEncodedDate()
        Deprecated.
        Encodes the date as used by Firebird (Modified Julian Date, or number of days since 17 November 1858).
        Returns:
        Encoded date
        Since:
        4.0
      • getEncodedTime

        public int getEncodedTime()
        Deprecated.
        Encodes the time as used by Firebird (fractions (100 milliseconds) in a day).
        Returns:
        Encoded time
        Since:
        4.0