I can't understand time, look at my codes, I m very confuse this time

my codes below:
#include <stdio.h>
#include <time.h>

int main(int argc, const char * argv[]) {

long secondsSince1970 = time(NULL);
printf("it has been %ld seconds since 1970\n",secondsSince1970);
struct tm now;
long newtime;
localtime_r(&newtime, &now);

printf("the time is %d:%d:%d\n",now.tm_hour,now.tm_min,now.tm_sec);
// insert code here...
printf("Hello, World!\n");
return 0;


run answer below:

it has been 1465129475 seconds since 1970
the time is 1:41:28
Hello, World!
Program ended with exit code: 0

the question confuse me, is that whenever I run this codes, the time"1:41:28" and the number “140734799804488” can not be changed. Why???

According to the manual page: The function localtime() converts the time value pointed at by clock.

Therefore, you need to initialise the newtime object before calling that function.

struct tm now;
time_t newtime = time (NULL);
localtime_r (&newtime, &now);

thanks for your help!