ESP32 seconds from epoch
to return 'epoch' seconds there is a function time in time.h

time_t now;
time(&amp;now);


time_t is defined as long

this time is retrieved by the ESP32 SDK from NTP servers configured with  ESP32 Arduino function configTime

EDIT: it is the standard C time() function