made formatTime function private