struct ut_tv
which we got in the exercise of
Login/Logout exercise.
class Ctimeval {
public:
Ctimeval(int32_t sec = 0, int32_t usec = 0) {
tv_sec = sec;
tv_usec = usec;
}
private:
int32_t tv_sec; /* Seconds */
int32_t tv_usec; /* Microseconds */
};
operator<<()
to print
out the time value in the format like "Wed Mar 30 20:14:37 2022".
int main()
{
Ctimeval t1(1645633307, 622206);
Ctimeval t2(time(NULL));
cout << t1 << t2;
return 0;
}