my $datum = get_date(); sub get_date { my ($dd, $mm, $yy ) = ( localtime() )[3..5]; $yy += 1900; $mm += 1; return sprintf( "%04d-%02d-%02d", $yy, $mm, $dd ); }