class DateTimeFunctions {

    @ScalarFunction
    @LiteralParameters({"x", "y"})
    @SqlType("timestamp(3)") // TODO: increase precision?
    public static long dateParse(ConnectorSession session, @SqlType("varchar(x)") Slice dateTime, @SqlType("varchar(y)") Slice formatString)
    {
        DateTimeFormatter formatter = DATETIME_FORMATTER_CACHE.get(formatString)
                .withZoneUTC()
                .withLocale(session.getLocale());

        try {
            return scaleEpochMillisToMicros(formatter.parseMillis(dateTime.toStringUtf8()));
        }
        catch (IllegalArgumentException e) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e);
        }
    }

    private  DateTimeFunctions();

}