You might want to check out the library RTClib.h GitHub - adafruit/RTClib: A fork of Jeelab's fantastic RTC Arduino library
I use it with my DS1307 RTC modules.
With RTClib.h the call DateTime now = RTC.now() contains now.unixtime() which I understand to be a "kind of" unix time. From review of the library, I think it is an unsigned 32 bit number, and I have cast the variables which are assigned this value as unsigned longs. What is coming back(the last time I checked some time ago) is a 10 digit number 1399XXXXXX (1.399 E9). I don't know if it will get to 4,294,967,295 or 2,147,483,647 and if it rolls over in 2038 or somewhere in a farther world is of no real concern to me.
It may not be exactly the epoch time given by the Time Library, but using now.unixtime() with RTClib keeps things simple, with small library overhead, and has certainly simplified programming from when I tracked and calculated daily rollover using the native hh:mm:ss data format of the DS1307.