C/math.h/time — различия между версиями

Материал из C\C++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
м (1 версия: Импорт контента...)
 
(нет различий)

Текущая версия на 10:22, 25 мая 2010

time: returns the current calendar time of the system or -1 if the system has no time

    
//Declaration:  time_t time(time_t *time); 
  
  #include <time.h>
  #include <stdio.h>
  int main(void)
  {
    struct tm *ptr;
    time_t lt;
    lt = time(NULL);
    ptr = localtime(&lt);
    printf(asctime(ptr));
    return 0;
  }
         
/*
Sat Mar  3 16:12:48 2007
*/