use POSIX qw(strftime); $str = "1164414128"; print strftime '%Y-%m-%d %h:%m:%S', gmtime($str); #### SELECT ini_Rate.tUpdate from ini_Rate where ini_Rate.tUpdate > ini_Rate.tEnter limit 1; +---------------------+ | tUpdate | +---------------------+ | 2006-11-25 05:52:08 | +---------------------+ SELECT unix_timestamp(ini_Rate.tUpdate) from ini_Rate where ini_Rate.tUpdate > ini_Rate.tEnter limit 1; +-----------------------------------------+ | unix_timestamp(ini_Rate.tUpdate) | +-----------------------------------------+ | 1164414128 | +-----------------------------------------+