How to reset time on rtc ds1307

So I already set the time on an rtc module. But now i want to set the module to a different time, how would i do this? Whenever, i try to reset the time, the rtc is still counting from the previous time i set.

Can you post your code here between code tags.
If the time reverts to a previous time on system restart, there may be a statement in it which forces the rtc time to the time your sketch was compiled.

This is what I use. It is two separate programmes, one to set the clock, the other to use it.
http://bildr.org/2011/03/ds1307-arduino/
You predetermine the time and release the reset on the stroke.

So the code I used was from the example in the ds1307 library. Initially I was playing around with the rtc and set it to a random time. However when I wanted to set the time to the computer time, the clock still counts from the previous time I set. In other words, I cant change the time i originally set on this device. I tried to resolve this by creating a DateTime current variable( which accounts for the difference between the time set on the rtc and the computer time) so that I display on the actual time on the serial monitor. Is there a way I can just change the original time on the rtc without this variable.

// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {
while (!Serial); // for Leonardo/Micro/Zero

Serial.begin(9600);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}

if (! rtc.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(DATE), F(TIME)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
rtc.adjust(DateTime(2017, 4, 2, 13, 57, 0));

}
}

void loop () {
DateTime now = rtc.now();

Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" (");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();

Serial.print(" since midnight 1/1/1970 = ");
Serial.print(now.unixtime());
Serial.print("s = ");
Serial.print(now.unixtime() / 86400L);
Serial.println("d");

// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now + TimeSpan(7,12,30,6));

Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();

Serial.println();

// gives current time
DateTime current (now + TimeSpan(0,0,7,43.5));

Serial.print(" Real Time is ");
Serial.print(current.year(), DEC);
Serial.print('/');
Serial.print(current.month(), DEC);
Serial.print('/');
Serial.print(current.day(), DEC);
Serial.print(' ');
Serial.print(current.hour(), DEC);
Serial.print(':');
Serial.print(current.minute(), DEC);
Serial.print(':');
Serial.print(current.second(), DEC);
Serial.println();

Serial.println();
delay(1000);

}

Oh Canada

Use CTRL T to format the sketch. Please use code tags. Use the </> icon in the posting menu. [code] Paste sketch here. [/code]

.

Put this in setup()
setTime(10,00,00,02,04,17) ; //Hour,Minute,Second,Day,Month,Year, Change as needed
Upload the sketch.

Then comment that line out and upload your sketch again.

.