What library are you using to access the DS1307? I use RealTimeClockDS1307 https://github.com/davidhbrown/RealTimeClockDS1307 and it has a getDayOfWeek() to access the DAY register (3) on the DS1307. Most other libraries will probably have a similar function. Note that you need to set the DAY register correctly when setting the date & time. It is not a calculated value from the date but just a counter that counts from 1 to 7 and then resets back to one. This allows you to use what ever value you want (between 1 and 7) as the first day of the week.