I wish to obtain unix epoch timestamps in millisecond precision. I am using an ESP32 along with DS3231 RTC breakout board from adafruit.

Apparently the Repository is not maintained often but I see a PR which overcomes the rollover for software timer and the developer provided a patch in the comment to use the unix timestamps in ms.

I went to the libraries folder where all the downloaded adafruit repos exist. But when I did git status it mentions that the library download (from the library manager) is not a git repository.

I wan't to inculcate the changes to the RTClib library by using the patch provided. Should I just change the code directly via the Arduino IDE editor?

1 Answer 1


Save the patch to a file, put it in the directory holding the library, open a terminal on that directory and type:

patch -p1 < patchfile

You may have to install the "patch" utility if you don't have it yet. On a Debian-like OS (I don't know for other OSes):

sudo apt install patch
  • Well I blundered and cloned a fork from your repo and added the patch to it. Added this updated repo to the IDE. I think I will revert back to your method.
    – Shan-Desai
    Sep 28, 2018 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.