Strftime Function
Syntax:
size_t strftime(char *str, size_t maxsize, const char *fmt, const struct tm *time)
Example:
#include <time.h> #include <stdio.h> int main() { struct tm *xyz; time_t l; char str[90]; l = time(NULL); xyz = localtime(&l); strftime(str, 100, "It is now %I %p.", xyz); printf(str); return 0; }Back