Naguissa / uRTCLib

Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported.
https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html
GNU Lesser General Public License v3.0
88 stars 24 forks source link

UNIX Timestamp #29

Closed TCB13 closed 1 year ago

TCB13 commented 1 year ago

Hello,

Are there any plans to implement a method that will output a UNIX timestamp as an int? This would be very helpful since using timestamps is way easier than full dates.

Thank you.

Naguissa commented 1 year ago

Not really. There're other mature projects for doing so in library manager, like TimeLib: https://github.com/PaulStoffregen/Time

TCB13 commented 1 year ago

I was trying to avoid TimeLib because of its size. Having it builtin into uRTCLib was probably just a few lines of code without much impact on this library and a huge upside.

Naguissa commented 1 year ago

I've seen how Adafruit does it; do you think it could be interesting?

https://github.com/adafruit/RTClib/blob/master/src/RTClib.cpp

TCB13 commented 1 year ago

Hello,

If we're talking about https://github.com/adafruit/RTClib/blob/master/src/RTClib.cpp#L568 and https://github.com/adafruit/RTClib/blob/master/src/RTClib.cpp#L129 that's interesting.

Thank you.

Naguissa commented 1 year ago

Done! https://github.com/Naguissa/uUnixDate

I'm requesting IDE insertion right now, may be in few days.

TCB13 commented 1 year ago

@Naguissa thank you for the new lib!