We discuss the application of ab initio X-ray diffraction (AIXRD) to the interpretation of time-resolved and static X-ray diffraction. In our approach, elastic X-ray scattering is calculated directly from the ab initio multiconfigurational wave function via a Fourier transform of the electron density, using the first Born approximation for elastic scattering. Significant gains in efficiency can be obtained by performing the required Fourier transforms analytically, making it possible to combine the calculation of ab initio X-ray diffraction with expensive quantum dynamics simulations. We show that time-resolved X-ray diffraction can detect not only changes in molecular geometry but also changes in the electronic state of a molecule. Calculations for cis-, trans-, and cyclo-butadiene, as well as benzene and 1,3-cyclohexadiene are included.