clean the datetime handling