use POSIX qw( strftime ); sub getMysqlTime { return POSIX::strftime("%Y-%m-%d %H:%M:%S", gmtime(shift)); }