I'm a complete novice to perl and have been given the project of fixing another persons code, and to that end I have a question... using the date statement
# get filename from yesterday
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= localtime(time()-24*3600);
$mon++;
if(length($mon)==1) { $mon="0$mon"; }
if(length($mday)==1) { $mday="0$mday"; }
$yesterday = "\_$year$mon$mday.zip";
print "Need to get file $yesterday\n";
I get a year of 10 can someone please help, I'm desperate.
Thank you in advance
In reply to Date/Time
by RAS109
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.