Time synchronization is very important for a Time Division Multiple Access (TDMA) Wireless Sensor Networks (WSNs). In this paper, we introduce a new method of time synchronization for WSNs based on the simulated annealing algorithm which is endowed with the search process of a time-varying and can effectively avoid falling into the local minimum and finally tends to the global optimum. Errors between the global time and prediction time are used as the evaluation function from which we can obtain more stable time synchronization. Our method is implemented on SCSC-RFA1 platform and the results show the validity of the method.