my ($sec,$min,$hour,$mday,$mon,$year) = localtime(スレッドキー);
printf("%4d-%02d-%02d %02d:%02d:%02d\n", $year+1900, $mon+1, $mday, $hour, $min, $sec);

こんな感じで。