Context : Massive luminous red galaxies ( LRGs ) are believed to be evolving passively and can be used as cosmic chronometers to estimate the Hubble constant ( the differential age method ) . However , different LRGs may be located in different environments . The environmental effects , if any , on the mean ages of LRGs , and the ages of the oldest LRGs at different redshift , may limit the use of the LRGs as cosmic chronometers . Aims : We aim to investigate the environmental and mass dependence of the formation of ‘ quiescent ’ LRGs , selected from the Sloan Digital Sky Survey Date Release 8 ( SDSS ) , and to pave the way for using LRGs as cosmic chronometers . Methods : Using the population synthesis software STARLIGHT , we derive the stellar populations in each LRG through the full spectrum fitting and obtain the mean age distribution and the mean star formation history ( SFH ) of those LRGs . Results : We find that there is no apparent dependence of the mean age and the SFH of quiescent LRGs on their environment , while the ages of those quiescent LRGs depend weakly on their mass . We compare the SFHs of the SDSS LRGs with those obtained from a semi-analytical galaxy formation model and find that they are roughly consistent with each other if we consider the errors in the STARLIGHT-derived ages . We find that a small fraction of later star formation in LRGs leads to a systematical overestimation ( \sim 28 \% ) of the Hubble constant by the differential age method , and the systematical errors in the STARLIGHT-derived ages may lead to an underestimation ( \sim 16 \% ) of the Hubble constant . However , these errors can be corrected by a detailed study of the mean SFH of those LRGs and by calibrating the STARLIGHT-derived ages with those obtained independently by other methods . Conclusions : The environmental effects do not play a significant role in the age estimates of quiescent LRGs ; and the quiescent LRGs as a population can be used securely as cosmic chronometers , and the Hubble constant can be measured with high precision by using the differential age method .