WARNING of subtle bug / feature:
createDateFromFormat (with format 'Y-m-d' for this example) will happily accept '2022-02-29' (February 29 in a non-leap year) and turn it into '2022-03-01' with no warnings, possibly creating weird bugs in your application.