#include <time.h>
#include <stdio.h>
int main() {
time_t now;
char format_time[20];
time(&now);
strftime(format_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&now));
printf("%s\n", format_time);
}
#include <time.h>
#include <stdio.h>
int main() {
time_t now;
char format_time[20];
time(&now);
strftime(format_time, 20, "%Y-%m-%d %H:%M:%S", localtime(&now));
printf("%s\n", format_time);
}