System modification time in Windows
Void uimanager: setpolicime () {// # include <windows. h> // # include <stdlib. h> systemtime s; // getlocaltime (& S); // setlocaltime (& S) // The Greenwich Mean Time obtained by getsystemtime (), which is the global standard time. Setsystemtime (& S) s. wyear = 2000 + temp [0] * 10 + temp [1]; S. wmonth = temp [2] * 10 + temp [3]; S. wday = temp [4] * 10 + temp [5]; S. whour = temp [6] * 10 + temp [7]; S. wminute = temp [8] * 10 + temp [9]; If (setlocaltime (& S) cout <"setting time is success" <Endl; else cout <"setting time is not success" <Endl ;}
Linux system modification time
Void uimanager: sethwcolock (string datetime) {string d = "sudo date-s '" + datetime + "'"; // enter the password, remove sudo System (D. c_str (); System ("sudo hwclock -- systohc"); // to enter the password, remove sudo // system ("sudo hwclock") from the Board "); // verify whether the modification is successful}