Yes, why not? Most SNTP sketches obtain the time in NTP format, then convert to Epoch time. That is the logical approach, since both keep time in units of integer seconds. Some go on to do further conversion to YYMMDD etc., but you can ignore that if you don't want to use it.
It's not a general question, you have to decide what maximum latency to allow.
More generally, what specific hardware/software do you have, and what specific problem are you having with it? If you are getting "wrong data" then it is likely that either your network connection or your sketch is broken. Typically, you should get an NTP response in about 100-200 ms.
Rmen:
Thanks
but I still need to some example code for my question.
Here is some pseudocode:
t = received NTP time (converted to epoch)
RTC = t
In the sketch I posted a link to, NTP is converted and stored in the variable, 'epoch', which is printed. Just pass that value to the set method of the RTC library you're using.
1- Is it possible set Unix Epoch time from NTP (Ethernet Module) to RTC DS1307 or DS3231 without delay ?
please send sample code.
I try search for more library but more of them using (y,m,d,h,m,s) variable.
I think it's cased delay and wrong time.
There is no memory register within a ds3231 or ds1307 rtc module which stores Unix Epoch Time. The time stamp needs conversion to the BCD format of the rtc memory.
You have to use an RTC library to do the conversion or else convert yourself.
For example using the Michael Margolis DS1307RTC.h the command is