Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- int main(){
- int i;
- system("title Hora_Atual");
- struct tm *Horario;//ponteiro
- time_t hora; //variavel
- time(&hora);
- Horario=localtime(&hora);
- printf("\tHora e data atual\n");
- //macro time
- printf("%s %s\n",__TIME__ ,__DATE__);
- printf("Dia da semana %d\n",Horario->tm_wday+1);
- printf("Dia do ano %d\n",Horario->tm_yday);
- //testa se existe horaio de verao
- i=(Horario->tm_isdst);
- if(i==0)
- printf("nao ha horario de verao\n");
- else
- printf("horario de verao %d\n",Horario->tm_isdst);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement