datetime: add error handle