Permalink
Browse files

fixed dayofweek (again)

  • Loading branch information...
2 parents d59bb4f + dfcc7d8 commit 72fc1a4799712ed523bdba0f3698937046e3e465 @ladyada ladyada committed Jul 30, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 RTClib.cpp
View
@@ -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 {

0 comments on commit 72fc1a4

Please sign in to comment.