Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Programacion a Bajo Nivel. APIs, Hooking, ASM, C/C++, etc.
 » 

Función Time



Autor Tema: Función Time  (Leído 1119 veces)

Desconectado P4|3L0

  • Asiduo
  • *
  • Mensajes: 75
  • TecnoHacker un nuevo proyecto.
    • http://www.tecnohacker.com
Función Time
« en: Diciembre 29, 2009, 10:40:35 am »
La función localtime convierte el tiempo en formato condensado apuntado por tiempoPtr en el tiempo en formato separado, expresado como el tiempo local.

Valor de retorno:

La función localtime retorna un puntero al objeto.


Código: You are not allowed to view links. Register or Login
#include <stdio.h>
#include <time.h>

int main()
{
  time_t tiempo;
  char cad[80];
  struct tm *tmPtr;

  tiempo = time(NULL);
  tmPtr = localtime(&tiempo);
  strftime( cad, 80, "%H:%M.%S, %A de %B de %Y", tmPtr );

  printf( "La hora local es: %s\n", asctime(tmPtr) );
  printf( "La hora y fecha locales son: %s\n", cad );

  return 0;
}


Publico esto, por si no conocían la libreria time.h

Errores, consejos.



Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal