class TemporalFunction {

    public static int getDay(Type type, Block block, int position)
    {
        if (type.equals(DATE)) {
            return toIntExact(DATE.getLong(block, position));
        }

        if (type.equals(TIMESTAMP_MILLIS)) {
            long days = floorDiv(TIMESTAMP_MILLIS.getLong(block, position), MICROSECONDS_PER_DAY);
            return toIntExact(days);
        }

        throw new IllegalArgumentException("Wrong type for temporal column: " + type);
    }

    private  TemporalFunction();

}