asctime : asctime « time.h « C Tutorial






ItemValue
Header filetime.h
Declarationchar *asctime(const struct tm *ptr);
Returnreturns a string for tm in the following form:


day month date hours:minutes:seconds year\n\0

For example:

Fri Apr 15 12:05:34 2005
#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








25.2.asctime
25.2.1.asctime