use POSIX qw(strftime); print strftime "%Y-%m-%d",localtime(time);