Class DateFunction


public class DateFunction extends ToDate
DATE(<expr>) — the alias of TO_DATE that ALSO accepts an epoch NUMBER. Live-verified on a real account: SELECT DATE(1631711999) is 2021-09-15 while the identical SELECT TO_DATE(1631711999) fails "invalid type [TO_DATE(1631711999)] for parameter 'TO_DATE'". Everything else is TO_DATE's behaviour.
  • Constructor Details

    • DateFunction

      public DateFunction()
  • Method Details

    • acceptsNumericEpoch

      protected boolean acceptsNumericEpoch()
      Description copied from class: ToDate
      Whether a NUMBER argument may be read as an epoch. Live-verified on a real account: TO_DATE(1631711999) and TRY_TO_DATE(1631711999) both fail "invalid type [TO_DATE(1631711999)] for parameter 'TO_DATE'", while the DATE() alias of the very same function returns 2021-09-15 and TO_TIMESTAMP(1631711999) works — so the restriction belongs to the TO_DATE spelling, not to the epoch conversion. A numeric STRING stays legal (TO_DATE('1631711999') is 2021-09-15).
      Overrides:
      acceptsNumericEpoch in class ToDate