Pseudo real-time clock using Ticker interruption, also implements time() and set_time() for platforms that don't (such as mBuino)
Fork of PseudoRTC by
Diff: PseudoRTC.cpp
- Revision:
- 3:c8bfeb8a2989
- Parent:
- 2:7d153bc7403f
--- a/PseudoRTC.cpp Mon Aug 03 09:04:48 2015 +0000 +++ b/PseudoRTC.cpp Mon Aug 03 10:29:25 2015 +0000 @@ -59,7 +59,7 @@ minute=ptm->tm_min; hour=ptm->tm_hour; day=ptm->tm_mday; - month=ptm->tm_mon; + month=ptm->tm_mon+1; year=ptm->tm_year+1900; } @@ -125,7 +125,7 @@ tms.tm_min=minute; tms.tm_hour=hour; tms.tm_mday=day; - tms.tm_mon=month; + tms.tm_mon=month-1; tms.tm_year=year-1900; return(mktime(&tms)); }