If you want to print the date in a C program, have a look at this.
So the code would be something, like this:
#include <stdio.h>
#include <time.h>
int main()
{
time_t t = time(NULL);
struct tm dt = *localtime(&t);
printf("now: %d-%02d-%02d %02d:%02d:%02d\n", dt.tm_year + 1900, dt.tm_mon + 1, dt.tm_mday, dt.tm_hour, dt.tm_min, dt.tm_sec);
}