asctime: returns a string for tm in the following form: day month date hours:minutes:seconds year : asctime « time.h « C / ANSI-C






asctime: returns a string for tm in the following form: day month date hours:minutes:seconds year


    

//Declaration:  char *asctime(const struct tm *ptr); 



  #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:43 2007
*/ 

           
       








Related examples in the same category