itshardtogetone wrote:
Hi,

Hello,

How do I randomly produce a date between 1st Jan 1960 to 31th December
1985. It must be able to show the day month year.
I only know how to produce a random number between 1960 to 1985 using
rand like this :

my $year = int (rand 26) + 1960;

use Time::Local;

my $start = timegm 0,0,0,1,0,60;
my $end   = timegm 0,0,0,1,0,86;

print scalar gmtime $start + rand $end - $start;




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to