Update Time.cpp

LEAP_YEAR bad macro - need in parentheses.
This commit is contained in:
zharovdv
2018-01-20 17:03:32 +03:00
committed by GitHub
parent 7251f894a1
commit 514666593a

View File

@@ -144,7 +144,7 @@ int year(time_t t) { // the year for the given time
/* These are for interfacing with time serivces and are not normally needed in a sketch */
// leap year calulator expects year argument as years offset from 1970
#define LEAP_YEAR(Y) ( ((1970+Y)>0) && !((1970+Y)%4) && ( ((1970+Y)%100) || !((1970+Y)%400) ) )
#define LEAP_YEAR(Y) ( ((1970+(Y))>0) && !((1970+(Y))%4) && ( ((1970+(Y))%100) || !((1970+(Y))%400) ) )
static const uint8_t monthDays[]={31,28,31,30,31,30,31,31,30,31,30,31}; // API starts months from 1, this array starts from 0