The birth of computer networks and distributed systems has led to the appearance of the clock synchronization problem. This issue has gained increasing importance with the emergence of new resource constrained networks such as wireless sensor networks. In this paper, we propose a new distributed clock synchronization algorithm, referred to as Weighted Consensus Clock Synchronization (WCCS), whose objective is to achieve a consensus clock among network nodes. In this distributed approach and in contrast to centralized schemes, each node periodically exchanges the local clock reading with its immediate neighbor nodes. Then, each node employs these time informations to calculate its relative offset and skew with respect to its neighbor nodes using a weighted average consensus based technique. The effectiveness of WCCS is proved through both simulations and an experimental study on TelosB mote using TinyOS.