Skip to content

Commit

Permalink
fixed dayofweek (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jul 30, 2010
2 parents d59bb4f + dfcc7d8 commit 72fc1a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RTClib.cpp
Expand Up @@ -105,8 +105,8 @@ DateTime::DateTime (const char* date, const char* time) {
}

uint8_t DateTime::dayOfWeek() const {
uint16_t day = unixtime() / SECONDS_PER_DAY;
return (day + 4) % 7; // Jan 1, 2000 is a Thursday, i.e. returns 4
uint16_t day = date2days(yOff, m, d);
return (day + 6) % 7; // Jan 1, 2000 is a Saturday, i.e. returns 6
}

uint32_t DateTime::unixtime(void) const {
Expand Down

0 comments on commit 72fc1a4

Please sign in to comment.