This paper proposes a new time synchronization algorithm for wireless sensor networks, named clustered consensus time synchronization (CCTS). This algorithm is developed on the base of the distributed consensus time synchronization (DCTS) algorithm. However, to obtain faster convergence in the clock synchronization of node and better energy efficiency, the clustering technique is incorporated into the algorithm. The CCTS includes two parts: 1) intracluster time synchronization and 2) intercluster time synchronization. In the intracluster time synchronization, the improved DCTS is applied. The cluster head is responsible for exchanging messages within the cluster. The average value of skew compensation parameters of intracluster virtual clock and the average value of intracluster virtual clocks are used to update the skew compensation parameter and offset compensation parameter, respectively. In the intercluster time synchronization, cluster heads exchange messages via gateway nodes. To update the clock compensation parameters of the network virtual clocks, clock compensation parameters of intracluster virtual clocks of every cluster head are assigned with corresponding weights based on the size of each cluster. The simulation results show that the proposed algorithm reduces the communication traffic compared with the DCTS algorithm, and improves the convergence rate due to the combination of clustering topologies.