Recommender systems are used in various applications to boost the prediction accuracy of user preferences. The recent developments in recommendation frameworks support precise user decisions on any item depending on the actions of logged users. Although the existing algorithms exhibit good performance, some temporal aspects of user data require attention. This study introduces a new algorithm that utilises the users' temporal effects by extracting time-bins as recent rating timelines. After error-function-based analyses for the optimal time-bins, the time-bin-based algorithm is employed to filter the best neighbours. Analyses show that the optimal time-bin size is 41 for the MovieLens dataset while 48 for the Netflix Prize dataset. Therefore, considering the cold start problem, a flexible time-bin approach is also proposed. The time-bin-based algorithm offers improvements of 7,44% (MovieLens) and 5,36% (Netflix) for the Matthews correlation coefficient and increases the balanced accuracy by 3,78% (MovieLens) and 2,06% (Netflix). Negative predictive value and specificity reveal high percentages for most rating classes, similar to the state-of-the-art approach. Finally, the standard accuracy metric demonstrates an improvement of 1,86% for MovieLens and 2,36% for the Netflix dataset.