managing date format as datetime - checking if value in data array