Updating Time on Boot in android OS

I am running android 4.4.2 on a BeagleBone Black.

I have used a DS1307 RTC externally for the purpose of updating the Time everytime the OS boots up.
Or using the internal clock running on power off with a battery ?

Is there a way to do so on Boot ?
or is there any code that can be put in an app to update time ?

Any sort of help is appreciated … Extra languages or apps or hardware can be used.

Thank you.