Fix UDF date formatting

Fixes #1046
I vaguely remember having a discussion about that, too.