Abstract Abstract: Investigating the impact of the built environment around rail stations on ridership as well as assessing the spatial and temporal variation of that impact is helpful to improving the operational efficiency of urban public transport and guiding station planning and development. Based on 14 days of smart card data in Nanjing, 159 metro stations were taken into consideration in this paper to explain the changing patterns among weekday and weekend ridership. Three types of characteristics were selected as explanatory variables, namely built environment variables, socioeconomic variables and transit service variables. For models, we applied geographically and temporally weighted regression (GTWR) to analyse how the built environment affects ridership from spatial and temporal perspectives and compared its fitting degree in ordinary least squares (OLS) and geographically weighted regression (GWR) models. The results reveal that GTWR performs well in the fitting results and is thus suitable for exploring the association between rail transit ridership and the built environment. In addition, the coefficient of the explanatory variables is influenced by both temporal and spatial factors, with critical importance in the temporal dimension of the analysis of passenger flow. Furthermore, while following the same trend, the impact coefficient, which is mainly affected by commuter traffic, shows stronger temporal heterogeneity during weekdays than weekends. Considering the characteristics of residents' travel activities, the internal relationship between urban space and traffic operation is explored to provide theoretical guidance and suggestions for improving the efficiency of public transport operation and optimizing the layout of urban space.