#!/usr/bin/perl use POSIX qw(strftime); foreach (<>) { s/(\d{5,})/strftime("%Y-%m-%d %H:%M:%S", localtime($1))/e; print; }