try_to_timestamp not working as expected

PriyanshuKumar
New Contributor

try_to_timestamp should return NULL for following expression but it is throwing error:

 

try_to_timestamp(
           '2019-02-28 23:59:59.000',
          'yyyy-MM-dd HH:mm:ss'
        )

 

I understand above expression is wrong as the date format does not confirm to the datetime literal, but I expect a null instead of INCONSISTENT_BEHAVIOR_CROSS_VERSION.PARSE_DATETIME_BY_NEW_PARSER error.