mercredi 20 novembre 2019

How can I input a set start and end time using Chrono or ctime libaray

I'm having a hard time understanding time with in c++. I want to input values for time like this.

time_t  t = time(0);
tm* now = localtime(&t);
cin >> now->tm_wday >> now->tm_mon >> now->tm_year;

I feel this is a wrong way of doing this. my main objective is to try create a start time and date and an end time and date and have the object run until the given end time and date. With inputting time values confuses me and would like a little help steering me in the right direction.

Aucun commentaire:

Enregistrer un commentaire