Time Gears are ancient relics of great importance in the Pokémon Mystery Dungeon series. Their sole purpose in existence is to regulate the flow of time within the Pokémon World. Once stolen from their specific area, the flow of time within that area alone will grind to a halt.
In the games Grovyle is stealing Time Gears and thought of being bad, but when Dusknoir comes, telling himself as a big explorer, but after a while Dusknoir reveals he and Grovyle are from the future, and he is the good Pokémon and Grovyle is a wanted outlaw.
When they capture Grovyle, Dusknoir opens a portal to the future in Treasure Town, and, when he is about to return, he grabs you and your partner and enters the portal. You soon find out that Grovyle is attempting to restore the balance of time, while Dusknoir tries to stop him. When you return to the past you tell the guild that Grovyle is good, and he was stealing time gears to prevent the destruction of Temporal Tower. The guild thinks you are confused, and then you go to bed.
After a while you go to Brine Cave and find out there is a symbol on the wall and it reacts with you partner's stone and Lapras who will give you a ride to Hidden Land to find the Rainbow Stone Ship. There, your partner looks at the Rainbow Stone Ship; however, Dusknoir and his Sableye attack you and Grovyle.
After defeating Dusknoir, he tries to attack you, but Grovyle takes the hit and tries to push Dusknoir into the portal leading to the future. Then, your partner comes back.
After that you ride the Rainbow Stone Ship to Temporal Tower. You go through Temporal Tower and fight Primal Dialga. Later, you discover that Darkrai caused Temporal Tower to collapse, and that he separated you and Grovyle when you were traveling to the past and turned you into a Pokémon.