Fix date/time format if no time specified

Close #1150