User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:time.h:asctime
click
to support this page (eg 0,42 € or so) Thanks.

asctime

   char *asctime(const struct tm *timeptr);

Description

The function asctime() converts the time in the struct ptr to a character string of the format: Day Month Date Hour:Minute:Second Year\n\0

asctime C Sourcecode Example

/* 
 * asctime example code
 * http://code-reference.com/c/time.h/asctime 
 */
#include <stdio.h>
#include <time.h>
 
int main ( void )
{
  time_t rawtime;
  struct tm * timeinfo;
 
  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  printf ( "Current Date is: %s", asctime (timeinfo) );
 
  return 0;
}

asctime output

  Current Date is: Sat Apr 21 13:13:46 2012

see also

advertising
c/time.h/asctime.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum