ctime - C time.h

C examples for time.h:ctime

Type

function

From


<ctime>
<time.h>

Description

Convert time_t value to string

Prototype

char* ctime (const time_t * timer);

Parameters

ParameterDescription
timer a time value in type time_t.

Return Value

date and time information in a human-readable format.

Demo Code


#include <stdio.h>
#include <time.h>

int main ()/*from   w ww  .  j  ava 2s  . co  m*/
{
  time_t rawtime;

  time (&rawtime);
  printf ("The current local time is: %s", ctime (&rawtime));

  return 0;
}

Related Tutorials