Class DateTypeHelper

java.lang.Object
dev.frostlake.functions.scalar.DateTypeHelper

public final class DateTypeHelper extends Object
Small shared helper for the date/time functions. The engine represents both DATE and TIMESTAMP values as strings (and a few functions as LocalDate / LocalDateTime), so "is this value a pure DATE?" cannot be answered by type alone — a date-only string (2023-01-31) is a DATE while a string with a time component is a TIMESTAMP. This decides so DATEADD / DATE_TRUNC can keep DATE inputs a DATE for day-or-larger units instead of widening them to a timestamp.
  • Method Details

    • isDateOnly

      public static boolean isDateOnly(Object value)
      Whether value represents a pure DATE (no time-of-day): a LocalDate, or a string of the form yyyy-[m]m-[d]d with no trailing time. A LocalDateTime or a string carrying a time component is NOT date-only.