For example i tried to compare both of the month's results
the first Serial command give me 7, the current month. but the second gave me another variable result
can anyone help me please?
As far as I can see month does expect a time_t. Aka, you try to do something that's not possible the way you do it. I don't see an easy way of moving back from unix time. Any reason why you want to use unix time?
That's why it comes with all the neat functions... You can use those to add/subtract time. So don't really see the problem there. Especially because you have the same problem with a unix timestamp.
I am curious as to what exactly dt.now is returning. I would expect a function that returns a time_t to be Epoch time. (Unix Time). So what exactly is being return by dt.now?
OP, for my own curiosity, can you output the 2 values. the dt.now as well as the dt.UnixTime.
You should be able to use this site.
To convert the value. I have never used an RTC on an arduino, might have to pull one out of the bin.
cattledog - i don't know what to say. i get difference result.
Romonaga - i'm not sure i understood you, but i get the same result for:
Serial.println(dt.unixtime());
Serial.println(timenow);
very strange for me...
yossi84:
cattledog - i don't know what to say. i get difference result.
Romonaga - i'm not sure i understood you, but i get the same result for:
Serial.println(dt.unixtime());
Serial.println(timenow);
very strange for me...
2313943001
2313943001
something is wrong with my system. i don't know what happend meanwhile, but some hours ago i got the right value in both of commands.