handle datetime and timestamp