{"action":"closed","issue":{"url":"https://api.github.com/repos/adafruit/RTClib/issues/45","labels_url":"https://api.github.com/repos/adafruit/RTClib/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/adafruit/RTClib/issues/45/comments","events_url":"https://api.github.com/repos/adafruit/RTClib/issues/45/events","html_url":"https://github.com/adafruit/RTClib/issues/45","id":108519331,"number":45,"title":"+ operator for DateTime with Timespan (rvalue) seems to be dysfunctional.","user":{"login":"Oligodendrogliom","id":14039470,"avatar_url":"https://avatars.githubusercontent.com/u/14039470?v=3","gravatar_id":"","url":"https://api.github.com/users/Oligodendrogliom","html_url":"https://github.com/Oligodendrogliom","followers_url":"https://api.github.com/users/Oligodendrogliom/followers","following_url":"https://api.github.com/users/Oligodendrogliom/following{/other_user}","gists_url":"https://api.github.com/users/Oligodendrogliom/gists{/gist_id}","starred_url":"https://api.github.com/users/Oligodendrogliom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oligodendrogliom/subscriptions","organizations_url":"https://api.github.com/users/Oligodendrogliom/orgs","repos_url":"https://api.github.com/users/Oligodendrogliom/repos","events_url":"https://api.github.com/users/Oligodendrogliom/events{/privacy}","received_events_url":"https://api.github.com/users/Oligodendrogliom/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-27T07:17:00Z","updated_at":"2015-10-06T04:31:10Z","closed_at":"2015-10-06T04:31:10Z","body":"I'm having the following code as part of my own class:\r\n\r\n    DateTime TimeKeep::nowUTC()\r\n    {\r\n    \treturn rtc.now();\r\n    }\r\n    \r\n    DateTime TimeKeep::now()\r\n    {\r\n    \treturn rtc.now()+TimeSpan(0, dst+tz/4, tz%4, 0);\r\n    }\r\n\r\nwhile rtc is of type RTC_DS1307 and dst=1 and tz=4. I checked for TimeSpan::totalseconds() returning the 7200 seconds correctly. But the outcome of my now() function gets wrong.\r\n\r\n    \tDateTime dt=TimeKeep::now();\r\n\tSerial.print(\".\"); Serial.print(dt.year()); Serial.print(\".\"); Serial.print(dt.month()); Serial.print(\".\"); Serial.print(dt.day());\r\n\tSerial.print(\"-\"); Serial.print(dt.hour()); Serial.print(\":\"); Serial.print(dt.minute()); Serial.print(\":\"); Serial.print(dt.second());\r\n\tdt=TimeKeep::nowUTC();\r\n\tSerial.print(\".\"); Serial.print(dt.year()); Serial.print(\".\"); Serial.print(dt.month()); Serial.print(\".\"); Serial.print(dt.day());\r\n\tSerial.print(\"-\"); Serial.print(dt.hour()); Serial.print(\":\"); Serial.print(dt.minute()); Serial.print(\":\"); Serial.print(dt.second());\r\n\r\nThis code yields for a given time:\r\n\r\n    2043.4.30-11:16:56.2000.0.0-15:45:12\r\n\r\nThe wrong addition of TimeSpan is consistent. The interval between both DateTime is always the same."}}