"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.
Umesh Yadav's birthday: Indian cricketers and their tales of struggle
Photos: WWE star Sheamus and John Abraham clash in Mumbai
Photos: Raveena Tandon, husband Anil Thadani's dinner date in Bandra
Photos: Kareena Kapoor Khan spotted at Mumbai airport
Photos: Aamir Khan with brother Faisal, ex-wife Reena Dutta at MAMI