#include <time.h>
#include <stdio.h>
int main()
{
time_t nowtime = time(NULL);
tm *now = localtime(&nowtime);
printf("now: %04d-%02d-%02d %02d:%02d:%02d\nunix time: %ld\n",
now->tm_year+1900, now->tm_mon+1, now->tm_mday,
now->tm_hour, now->tm_min, now->tm_sec, (long)nowtime);
return 0;
}