C Programming Language |
malloc |
calloc |
memset |
memcpy |
memory |
strcpy |
string |
strtok |
isalnum |
cctype |
errno |
cfenv |
clock |
difftime |
mktime |
ctime |
fprintf |
fscanf |
printf |
scanf |
stdio |
math |
defined in header file time.h
char *ctime( const time_t * timeptr);
Takes an argument of data type time_t which represents calendar time, and returns a string value equivalent to passed argument.
Parameter | Description |
---|---|
timeptr | pointer of data type time_t, contains calendar time value. |
string containing datetime information in a WWW MMM dd hh:mm:ss yyyy format.
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> /* memset */
// gcc -o ctime_prg ctime_prg.c
// ./ctime_prg
int main ()
{
printf("started program %s-%d\n", __FUNCTION__, __LINE__);
time_t timeptr;
time( &timeptr);
printf("ctime=%s\n", ctime( &timeptr));
return EXIT_SUCCESS;
}
ctime=Tue Mar 19 13:07:56 2019
zalloc is a third party library
posted on 2018-12-12 20:46:30 - C Programming Language Tutorials
posted on 2017-12-29 22:52:47 - C Programming Language Tutorials