Here a (view a) is single-line in Perl:
$ perl -MPOSIX -e '($d, $m, $y, $a) = @ARGV; print ((mktime(0,0,0,$d,$m+1,$y+$a-1900) - mktime(0,0,0,$d,$m+1,$y-1900)) / 86400)' 23 4 1975 29
10593
Of course, this discards the calculations of the key leap year of the function POSIX::mktime.
source
share