in reply to displaying the current date

sprintf "%.4d-%.2d-%.2d", $year+1900, $month+1, $mday