You are on page 1of 1

#include <iostream.

h>

#include <stdio.h>

#include <time.h>

int main() { // =================

char* dS[7] = {"Domingo","Lunes","Martes","Miercoles",

"Jueves","Viernes","Sabado"};

time_t tSac = time(NULL); // instante actual

struct tm* tmP = localtime(&tSac);

cout << "hh:mm:ss " << tmP->tm_hour << ":" << tmP->tm_min << ":"

<< tmP->tm_sec << endl;

cout << "dd-mm-aaaa: " << tmP->tm_mday << "-" << (tmP->tm_mon+1) << "-"

<< (tmP->tm_year+1900) << endl;

cout << "Dia de semana: " << dS[tmP->tm_wday] << endl;

cout << "Dia del año: " << tmP->tm_yday << endl;

cout << "Horario de verano: " << (tmP->tm_isdst ? "Si" : "No") << endl;

getchar();

You might also like