The problem is your seconds%=

Just do that:
if(seconds > 3600)
seconds-=3600;