pietyc has asked for the wisdom of the Perl Monks concerning the following question:
Edit by dws to add <code> tagsthe year is 2004 the month is 03 the day is 04 2004 03 04 2004 03 03 #!/usr/bin/perl my $yr = `date -u +%Y`; #get the output of year my $mm = `date -u +%m`; #get the output of month my $dd = `date -u +%d`; #get the output of day my $yyyymmdd = `date -u +%Y%m%d`; print "the year is $yr"; print "the month is $mm"; print "the day is $dd"; $new_date = "$yr$mm$dd"; print $new_date; $yes_dd = $dd -1; $yes_dd = 0 . $yes_dd; $yes_date = $yr.$mm.$yes_dd; print "$yes_date\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple question
by tachyon (Chancellor) on Mar 04, 2004 at 23:27 UTC | |
|
Re: simple question
by matija (Priest) on Mar 04, 2004 at 20:51 UTC | |
|
Re: simple question
by onegative (Scribe) on Mar 04, 2004 at 20:47 UTC | |
|
Re: simple question
by esskar (Deacon) on Mar 04, 2004 at 20:50 UTC | |
by Happy-the-monk (Canon) on Mar 04, 2004 at 21:46 UTC | |
|
Re: simple question
by BUU (Prior) on Mar 04, 2004 at 20:49 UTC | |
|
Re: simple question
by ambrus (Abbot) on Mar 04, 2004 at 20:50 UTC | |
|
Re: simple question
by bfdi533 (Friar) on Mar 04, 2004 at 22:28 UTC |