ctime



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.

Parameters
ParameterDescription
timeptrpointer of data type time_t, contains calendar time value.
Returns

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;
}


Output:

ctime=Tue Mar 19 13:07:56 2019



strtok

Split string into tokens

posted on 2019-03-17 20:41:48 - C Programming Language Tutorials


zalloc

zalloc is a third party library

posted on 2018-12-12 20:46:30 - C Programming Language Tutorials


math

posted on 2017-12-29 22:52:47 - C Programming Language Tutorials


Prompt Examples

ChatGPT Prompt Examples

posted on 2023-06-21 22:37:19 - ChatGPT Tutorials


Use Cases

Chat GPT Key Use Cases

posted on 2023-06-21 21:03:17 - ChatGPT Tutorials


Prompt Frameworks

Prompt Frameworks

posted on 2023-06-21 19:33:06 - ChatGPT Tutorials