Donald Trump has claimed Vladimir Putin told him he would never have invaded Ukraine if Trump had been president at the time.