obtener fecha y hora en c++



   AUTOR PREGUNTA

Publicado 21 abril 2014 - 01:24

¿Cómo puedo obtener la fecha y la hora en C++?


1 personas más tuvieron esta duda Yo también

 

Publicado 21 abril 2014 - 05:04

Para ello C posee las funciones _strtime y _strdate, te dejo un ejemplo de su uso:

#include
#include
using namespace std;
int main( )
{
char dateStr [9];
char timeStr [9];
_strdate(dateStr);
cout<< "La fecha es:" << dateStr ;
_strtime( timeStr );
cout << "\nLa hora es: "<< timeStr;

   AUTOR PREGUNTA

Publicado 21 abril 2014 - 05:41

Excelente Felip muchas gracias