Hello again perl monks!
My question is who can I tell if the user has logged in between two dates?
Say the first date is 2/21/6 : that is month,day of month, day
and the second is 2/22/7 : that is month, day of monty, day
I am trying to make a script that will let the user in if its within the last 24 hours of his first sign in. I can do that but I am having problems with the 24 hour clock part.
Here is my test script that I am trying to work this out, Please any help I would most appreciate!!
##Time function
@days = ("0","1","2","3","4","5","6");
@Months = ("0","1","2","3","4","5","6","7","8","9","10","11");
($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
($sec2,$min2,$hr2,$mday2,$mon2,$year2,$wday2,$yday2,$isdst) = localtim
+e(time-86400);
$year = $year + 1900;
$timerF="@Months[$mon]/$mday/@days[$wday]/$hr:$min:$sec";
$timerF2="@Months[$mon2]/$mday2/@days[$wday2]/$hr2:$min2:$sec2";
print "$timerF\n\n\n$timerF2";
Thanks in advance!
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.