Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • sizeof(int) on arduino (AVR) is 2, on most other platforms its 4. Commented Nov 17, 2021 at 10:51
  • 1
    Why log in binary? Log as text, in the format of date +'%FT%T%:z'. If you really need binary, log time_t rather than strcut tm. Commented Nov 17, 2021 at 10:54
  • @PMF I'm using ESP32, didn't specify, my bad! Commented Nov 17, 2021 at 11:04
  • @EdgarBonet logging to text is too slow, I log at 100hz using sd.h lib. why is logging time_t better in binary? Commented Nov 17, 2021 at 11:04
  • 3
    The layout of strcut tm is implementation dependent. In contrast, time_t is usually a simple integer, with very little variations across implementations: either 32 or 64 bits, and maybe a different epoch (which is fixed by simply adding a constant). Commented Nov 17, 2021 at 11:18