Fix broken DateTime conversions.

[ fix #2781 ]
[ fix #2777 ]