use POSIX (); sub getDateTime { return POSIX::strftime("%d-%m-%Y %H:%M:%S\n", localtime(time) ); }