So here's a little one-liner
That's rather large one-liner.
Simpler:
perl -MDateTime -le'$d = DateTime->new(year=>$ARGV[0]); $d->add(days => rand($d->is_leap_year?366:365)); print $d->ymd' year
It would probably be better if you returned a day no later than the current month & day to avoid changing your age.
In reply to Re: Random day of a year
by ikegami
in thread Random day of a year
by ambrus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |