Improve date/time handling #561