Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
the script below does not return the date correctly, can you tell me what I am doing wrong? Thank you.
My biggest issue is with the year. It appends a '1' to the date, so it looks like this: 20102#!/usr/bin/perl ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time +); $date = "$month/$mday/20$year"; print ("$date\n");
Edit Masem 2002-02-13 - Added code tags
Title edit by tye as single-word titles complicate future simple searches
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: date
by snowcrash (Friar) on Feb 13, 2002 at 08:31 UTC | |
Re: date
by demerphq (Chancellor) on Feb 13, 2002 at 09:38 UTC | |
by count0 (Friar) on Feb 13, 2002 at 16:55 UTC | |
by little (Curate) on Feb 13, 2002 at 19:04 UTC | |
Re: date
by little (Curate) on Feb 13, 2002 at 11:07 UTC | |
by beebware (Pilgrim) on Feb 13, 2002 at 18:47 UTC | |
by little (Curate) on Feb 13, 2002 at 18:54 UTC | |
Re: date
by beebware (Pilgrim) on Feb 13, 2002 at 16:31 UTC | |
by grinder (Bishop) on Feb 14, 2002 at 16:23 UTC | |
Re: date
by buckaduck (Chaplain) on Feb 14, 2002 at 01:55 UTC |
Back to
Seekers of Perl Wisdom