Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void agregarBoleta(time_t t, int seats, boletaVendida * &mat, int &n)
- {
- for (int i = 0; i < seats; i++)
- {
- addMemoria(mat, n);
- mat[n-1].fecha = t;
- }
- }
- time_t obtenerTime(int anio, int mes, int dia)
- {
- int year = anio;
- int month = mes;
- int day = dia;
- time_t rawtime;
- time_t finaltime;
- struct tm * timeinfo;
- /* get current timeinfo and modify it to the user's choice */
- time ( &rawtime ); // rawtime = unixtimestamp
- timeinfo = localtime ( &rawtime );
- timeinfo->tm_year = year - 1900;
- timeinfo->tm_mon = month;
- timeinfo->tm_mday = day;
- /* call mktime: timeinfo->tm_wday will be set */
- finaltime = mktime ( timeinfo );
- /*cout<<"Result: "<<finaltime<<endl;
- cout<<"Result: "<<time(NULL)<<endl;
- cout<<"Result: "<<timeinfo->tm_year<<endl;
- cout<<"Result: "<<timeinfo->tm_mon<<endl;*/
- return finaltime;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement