We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 660cf0d + 285cdda commit 1795affCopy full SHA for 1795aff
adafruit_datetime.py
@@ -1520,7 +1520,14 @@ def toordinal(self) -> int:
1520
return _ymd2ord(self._year, self._month, self._day)
1521
1522
def timestamp(self) -> float:
1523
- "Return POSIX timestamp as float"
+ """Return POSIX timestamp as float.
1524
+
1525
+ Note that Floats on most boards are encoded in 30 bits
1526
+ internally, with effectively 22 bits of precision. As a result,
1527
+ for modern dates this value can be off by several minutes.
1528
+ As a workaround you can access the function ``_mktime()``
1529
+ to get an int version of the timestamp.
1530
+ """
1531
if not self._tzinfo is None:
1532
return (self - _EPOCH).total_seconds()
1533
s = self._mktime()
0 commit comments