0

I have a time_t variable, I want to set system time (linux) using this variable. lets say,

time_t tmp;

I know that I can print this time using ctime(&tmp), and output would be like this.

Tue Jan 13 15:54:47 2015

how can I use this tmp variable to set my system time?

EDIT: This question is not a duplicate of question marked by moderator. For answer, please refer comment section.

saurabh agarwal
  • 2,124
  • 4
  • 24
  • 46

0 Answers0