The convective instability of a horizontal fluid layer subject to a time varying gradient of temperature is investigated. The stationary component of the temperature gradient is considered equal to zero and the oscillating components imposed on the horizontal boundaries are in phase and with the same amplitude. The aim of the present paper is to examine the effect of this type of modulation on the onset of convective instability. We show that unlike the case where the equilibrium configuration is stable in the absence of modulation, we have instability when the temperature at the horizontal boundaries is modulated in phase. Also, we observe that in the limit of low and high dimensionless frequency of modulation, ω < 0.5 and ω > 140, the basic state tends to a stable equilibrium configuration and for an intermediate dimensionless frequency, the system is potentially unstable. The results obtained from analytical asymptotic study for low and high dimensionless frequency are in good agreement with the numerical ones.