Hello All,
I am writing a Scheduler (posted question regarding timers earlier) which must handle long delays: from 1s to several days. What would be the easiest way to add, lets say, 10.000 seconds to the current Calendar time?
Is there any library to help me with RTC_TimeTypeDef & RTC_DateTypeDef manipulation or do I have to handle this manually? I feel that manual date handling (and different day count in different months) is going to be time consuming and somewhat redundant.
Thanks, G.
Thanks guys.
Apologies for the cross post. Tried to remove the other one, but no such option.
I've tried to use time.h functions but without success:
struct tm ti; ti.tm_sec = 0; ti.tm_min = 0; ti.tm_hour = 0; ti.tm_mday = 1; ti.tm_mon = 0; ti.tm_year = 0; ti.tm_isdst = 0; time = mktime(&ti);
It gives me time = 7C558180 or 2085978496 or Thu, 07 Feb 2036 06:28:16 GMT and i expected to get a year 1900. Also, it modifies my "ti" fields to some specific values like "ti.tm_year = 88;"
This is not the behaviour I've expected. The same applies to localtime()/gmtime(). I get no values at all (debugger doesn't show anything) and I expected to get a "struct tm" filled with 0 values.
time_t input input = 1; output = localtime(&input);
Any clues what I'm doing wrong to get such a strange behaviour?