Ernie Fitzpatrick (Pamela Adlon) is a daredevil kid who lives in Terra Dino with his best friend Max Santiago (Yuri Lowenthal) and his trouble-making sister Julia (Tara Strong) who likes to bust him. Ernie and Julia live with their mother Sue (Jane Lynch), who has been chosen as the mother of the year, but she is overprotective of them and often makes them leave notes. Ernie is told to go to the store after school to keep an eye on it, but he disobeys orders and goes with Max to the Terra Dino Museum to sneak into a forbidden part of the area still under construction to see the bones of the ferocious Sarcosuchus. But Julia enters as well and uses a quarter from Ernie to set off the alarm. Julia is able to escape but Ernie and Max get caught by the guards, and Sue grounds Ernie for three weeks. When Ernie finds out Julia did it, he gets sick and tired of how he never gets his own way, but he decides to get his revenge by sneaking out again, but Julia discovers this and follows.
Max’s punishment is helping out in the garage for a month with his father Dr. Santiago (Fred Tatasciore), an inventor who works on a time machine, which has not been working for four years. While Ernie and Max admire it, Julia reveals herself and threatens to call Sue, but Ernie tries to stop her, which results in him spilling soda on the control panel of the time machine, activating it and sends the kids back in time 65 million years ago, to the time of the dinosaurs.
When they emerge, they find a friendly Tyrannosaurus named Tyra (Melanie Griffith), who takes them in as her own. She also runs the orphanage for the dinosaurs without parents, and one of them is Dodger (Rob Schneider), who quickly befriends the kids, but the dinosaurs do not think that the kids can protect them from the evil Sarcosuchus Brothers, Sarco (William Baldwin) and Surly (Stephen Baldwin), who are in the Lower Valleys who plan to kill Tyra and take over the Upper Valley. Their three henchmen Morris (Nolan North), Borace (Tom Kenny) and Horace (John DiMaggio) find out about Tyra’s “newborn” babies and report back to the brothers. However, because they mistake the time machine for a real egg, they have Morris and his gang go to steal it so they can lure Tyra to come into their lair, thinking she will be looking for it. Sue and Dr. Santiago discover their kids’ disappearances and find out that Tyra’s real egg switched places with the time machine.