Twilight Sparkle was so busy trying to prevent the big disaster that she didn’t think to use the bathroom before trying to sneak into Canterlot. Ignoring how badly she needed to pee, she kept looking for a spell to stop time, and when the sun came up, she couldn’t hold it anymore and ended up peeing herself. Needless to say, when she found out there was no big disaster, she felt a little foolish not only freaking out but wetting herself over nothing, but she was able to get over it and laugh it off with Pinkie and Spike.
She hadn’t noticed the wetness on Future Twilight (including Spike’s ice cream sploshed on her butt), as she was facing her the entire time so she only noticed signs on her face and the front of her torn outfit.