Fix UDF date formatting

Fixes #1046
This is done