Question about sorting tables

I’ve got a table where the key value pairs are ordered by a randomly generated number( rolling a dice for a gamemode I’m making ) but I’d like to use table.sort or some other sorting method to index the key/value pairs by time, which is a column stored in the table. Any help would be appreciated. Thanks in advance!