Re: using perl to print yesterday's date, but with formatting options ?
- From: Purl Gurl <purlgurl@xxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 12:31:40 -0800
Purl Gurl wrote:
Purl Gurl wrote:Tom Van Overbeke wrote:
(snipped)
But the format I need is: 30.10.05
print $Array[3], ".", $Array[4] + 1, ".", $Array[5] + 1900;
print $Array[3], ".", $Array[4] + 1, ".0", $Array[5] - 100;
Somewhat obfuscated but named variables help with clarity in using different formats, as you request.
#!perl
($day, $month, $year) = (localtime(time - 86400)) [3,4,5];
print $day, ".", $month + 1, ".0", $year - 100;
print "\n\n";
print $month + 1, "-", $day, "-", $year + 1900;
Purl Gurl
.
- Follow-Ups:
- Re: using perl to print yesterday's date, but with formatting options ?
- From: A. Sinan Unur
- Re: using perl to print yesterday's date, but with formatting options ?
- From: Paul Lalli
- Re: using perl to print yesterday's date, but with formatting options ?
- From: Joe Smith
- Re: using perl to print yesterday's date, but with formatting options ?
- References:
- Prev by Date: Re: freeze panes in excel without using a module
- Next by Date: Re: freeze panes in excel without using a module
- Previous by thread: Re: using perl to print yesterday's date, but with formatting options ?
- Next by thread: Re: using perl to print yesterday's date, but with formatting options ?
- Index(es):