add formatDate and formatTime
expose functions for test
fix
order