[SOLVED] How to set time on DS1307 using Time library?

There is a second library that comes with the Time library, called DS1307RTC. Once the system time is set, all that is needed is a call to RTC.set():

#include <Time.h>
#include <DS1307RTC.h>
#include <Wire.h>
...
setTime(hr,min,sec,day,month,yr);
RTC.set(now());
1 Like