Interface TimestampValued

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long asEpochSecs()
      Gets the contained timestamp value as the number of seconds since Java epoch (January 1, 1970 00:00:00 GMT).
      Timestamp asTimestamp()
      Gets the contained timestamp value as a java.sql.Timestamp relative to the default time zone.
      int offsetSecs()
      Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.
      int subsecNanos()
      Gets the subsecond portion of the contained timestamp value.
    • Method Detail

      • asTimestamp

        Timestamp asTimestamp()
        Gets the contained timestamp value as a java.sql.Timestamp relative to the default time zone. The time zone used by TimeZone#getDefault() is used.
        Returns:
        the contained value as a java.sql.Timestamp. If null valued, as indicated by TokenValued.isNull(), null is returned.
      • asEpochSecs

        long asEpochSecs()
        Gets the contained timestamp value as the number of seconds since Java epoch (January 1, 1970 00:00:00 GMT). Timestamp values support nanosecond precision, although this method does not expose it. To access this level of detail, use subsecNanos() in conjunction with this method.
        Returns:
        the contained value as days since Java epoch. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
        See Also:
        subsecNanos()
      • subsecNanos

        int subsecNanos()
        Gets the subsecond portion of the contained timestamp value. The value returned is relative to the seconds value returned by asEpochSecs(). Thus the value asEpochSecs() * 1000000000 + subsecNanos() represents the number of nanoseconds since Java epoch.
        Returns:
        the subsecond portion of the contained value, in nanoseconds. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
        See Also:
        asEpochSecs()
      • offsetSecs

        int offsetSecs()
        Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.
        Returns:
        the time zone and daylight saving time offset of the contained value, in seconds. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
        See Also:
        asEpochSecs()