In this paper, we introduce a local principal component analysis approach to determining the number of common factors of a continuous-time factor model with time-varying factor loadings using high-frequency data. The model is approximated locally on shrinking blocks using discrete-time factor models. The number of common factors is estimated by minimizing the penalized aggregated mean squared residual error over all shrinking blocks. While the local mean squared residual error on each block converges at rate Symbol, where n is the sample size and p is the dimension, the aggregated mean squared residual error converges at rate Symbol; this achieves the convergence rate of the penalized criterion function of the global principal component analysis method, assuming restrictive constant factor loading. An estimator of the number of factors based on the local principal component analysis is consistent. Simulation results justify the performance of our estimator. A real financial dataset is analysed.