"Anybody who's divorced will tell you that the transition at the end of the summer, which, as a father, is the one time of year where you get to spend a lot of time with your kid, is very painful," he told Entertainment Weekly.
"You get confronted with the facts of your divorce. It's always a very painful moment for me. So that made it into the beginning of 'Before Midnight'," he added.
He is now married to Ryan Shawhughes and the couple has two children.
Photos: Salman Khan returns from Jodhpur to Mumbai
Pics: Sidharth Shukla-Rashami Desai's sizzling chemistry at TV show launch
Ooh La Lana! WWE Diva flaunts sexy curves in these 30 pictures
15 'peach' perfect photos of Priyanka Chopra at People's Choice Awards 2017
62 going on 16: These photos of Rekha prove she is 'forever young'