Recommender systems aim to suggest relevant items to users among a large number of available items. They have been successfully applied in various industries, such as e-commerce, education and digital health. On the other hand, clustering approaches can help the recommender systems to group users into appropriate clusters, which are considered as neighborhoods in prediction process. Although it is a fact that preferences of users vary over time, traditional clustering approaches fail to consider this important factor. To address this problem, a social recommender system is proposed in this paper, which is based on a temporal clustering approach. Specifically, the temporal information of ratings provided by users on items and also social information among the users are considered in the proposed method. Experimental results on a benchmark dataset show that the quality of recommendations based on the proposed method is significantly higher than the state-of-the-art methods in terms of both accuracy and coverage metrics.