Answer
The answer is Midnight in Paris, released in 2011 and directed by Woody Allen, in which he portrays the iconic Spanish surrealist artist, Salvador Dali. The film is a romantic comedy set in modern-day Paris, where the protagonist, Gil Pender, during his visit, is magically transported to the 1920s, where he meets and befriends renowned artists and writers of that era, including Dali.