perl - get year-month-day string

my($day, $month, $year)=(localtime)[3,4,5];
my $ymd = sprintf "%.4d-%.2d-%.2d", $year+1900, $month+1, $day;

output example: 2017-01-24

computer2know :: thank you for your visit :: have a nice day :: © 2018