fixed date/time handling to match html5 spec