Open hamudy1 opened 5 years ago
using namespace std;
int main() { time_t timer; struct tm *horarioLocal;
time(&timer); // Obtem informações de data e hora horarioLocal = localtime(&timer); // Converte a hora atual para a hora local
int dia = horarioLocal->tm_mday; int mes = horarioLocal->tm_mon + 1; int ano = horarioLocal->tm_year + 1900;
int hora = horarioLocal->tm_hour; int min = horarioLocal->tm_min; int sec = horarioLocal->tm_sec;
cout << "Horário: " << (hora-2) << ":" << min << ":" << sec << endl; cout << "Data: " << dia << "/" << mes << "/" << ano << endl;
return 0; }
[x] carregar programa quanto ao horário e data de entrada no estacionamento
[x] printar tudo na tela