Merge pull request #89 from zharovdv/master

Update Time.cpp
This commit is contained in:
Paul Stoffregen
2018-01-20 06:04:45 -08:00
committed by GitHub

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