0

I want to create a unixtime, to make some calcs. But when I save the year() (2015) in tmElements_t.Year, it trunks the bits and returns 223.

time_t ahora = now();
tini.Year=year(ahora); //2015 to 223
tini.Month=month(ahora);
tini.Day=day(ahora);
tini.Hour=ports[i].sample_hour;
tini.Minute=ports[i].sample_min;
tini.Second=ports[i].sample_sec;
makeTime(tini); //-->2765256165

Any idea where is the problem?

Thanks!

1 Answers1

0

Ok, it needs the offset, not the year.

So it should be in this case 2015-1970=45.