In this work, the problem of rigid body attitude control by magnetic torqueing is considered. The aim of the work is to derive an asymptotically stable solution to this problem, which is known to have two challenging properties: instantaneous underactuation due to the structure of the magnetic torque production law; time-variance due to the dependence of that law on the time-varying local geomagnetic field vector. To ensure an asymptotically stable motion towards the reference state in inertial space, a time-varying sliding manifold is proposed in this paper. The manifold has two parts. The first part is a linear function of states and is well-known in literature to be specific to the problem of rigid body attitude control by momentum exchange-or reaction-based torqueing. The second part consists of two integral terms with respect to time, whose integrands are respectively the angular orientation of the body in inertial space and the component of the control vector along the local geomagnetic field. These designed time-integral terms enable the application of the equivalent control method to the considered problem and make the state vector converge to the reference state in sliding mode. With their inclusion in the sliding vector, there exists a time-varying sliding mode in nonlinear rigid body motion controlled by magnetic torque, which is proven by the satisfaction of the reaching condition for the general reaching law. The presented exemplary results of simulation studies, which are carried out under both ideality assumption and non-ideal conditions that are modelled with high-fidelity, verify the mathematical results.