Class TimestampUtil

java.lang.Object
com.firebolt.jdbc.type.date.TimestampUtil

public class TimestampUtil extends Object
  • Constructor Details

    • TimestampUtil

      public TimestampUtil()
  • Method Details

    • convertToDate

      public static Date convertToDate(long millis, @Nullable TimeZone tz)
      Extracts the date part from a timestamp.
      Parameters:
      millis - The timestamp from which to extract the date.
      tz - The time zone of the date.
      Returns:
      The extracted date.
    • toTime

      public static Time toTime(String s, TimeZone tz) throws SQLException
      Parse a string and return a time representing its value.
      Parameters:
      s - The ISO formated time string to parse.
      tz - timezone
      Returns:
      null if s is null or a time of the parsed string s.
      Throws:
      SQLException - if there is a problem parsing s.
    • toTimestamp

      public static Timestamp toTimestamp(String s, @Nullable TimeZone tz) throws SQLException
      Parse a string and return a timestamp representing its value.
      Parameters:
      s - The ISO formated date string to parse.
      tz - timezone
      Returns:
      null if s is null or a timestamp of the parsed string s.
      Throws:
      SQLException - if there is a problem parsing s.