High-resolution measurements have been performed of the convective heat current as a function of time when a Rayleigh-Bénard cell is swept through its threshold with a specified time-dependent heat input. The results are interpreted in terms of the amplitude equation which exactly describes the slow variations in space and time of hydrodynamic quantities near the threshold. A phenomenological forcing field is added to this equation, and its form and magnitude are fitted to the onset time of the convective heat current. A deterministic model in which the field is an adjustable constant yields a good fit to the data for both a step and a linear ramp in the heat input. An alternative stochastic model, in which the field is a Gaussian variable with zero mean and a white-noise spectrum, is adequate for the ramp experiments, but cannot fit the step data for any value of the mean-square field. The systematics of the field and onset time versus ramp rate are studied in both the deterministic and stochastic models, and attempts are made to interpret the field in terms of physical mechanisms. When the data for long times are analysed in terms of the amplitude equation, it is found that the state first excited at onset is not the roll pattern which is stable in steady state. Instead, the system goes first to an intermediate state, which we tentatively identify as a hexagonal configuration. The decay of this state is governed by a further adjustable field in the amplitude equation.