The Situation
I have finished by study and applied to several jobs and have already had an interview with Company A and Company B. Company A is my first choice (better work, better salary, better working conditions), but Company B is quite okay (i.e., I did not sell myself short). Company B gave me a job-offer more or less directly after the interview, while Company A wanted to have a second interview which they could not schedule so soon, but they were informed about the job offer from Company B. Since I wanted to have security, I accepted the contract from Company B, but also accepted the second interview with Company A.
The Problem
I really want to work at Company A and I am willing to resign from my contract with Company B. However, there are some legal restrictions when I can resign from my contract with Company B, hence the date where I can start with Company A (if they hire me) is moved a few weeks into the future.
In the forthcoming interview with Company A, I have to tell the first date I can start with them. How can I communicate my situation without lying, but also keeping my chances high (e.g., they should not think that I will do the same to them. They were my first choice from the very beginning)? When should I tell this in the interview? At the very beginning, or only when they ask me?