use POSIX 'strftime'; print strftime '%Y-%m-%d', localtime();