Hello again!
I am posting this as a 2 in a sense from my last post.. Dakkar gave me this code,, It worked great I was able to play with it,,, Now, As one of the users pointed out I did not have a year --- So i tried to put a year in and i keep getting an error,, I have been working this thing out for a day now, and I would love some help! :D
use POSIX; # this module defines the function mktime
$last=$FORM{'userTime'}; # this is the timestamp of the user's last lo
+gin
$now=time; # the present
($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($now-$
+FORM{'timeControl'}); # a day ago
($mon2,$mday2,$wday2,$year2,$hr2,$min2,$sec2)=($last=~m|^(\d+)/(\d+)/(
+\d+)/(\d+)/(\d+):(\d+):(\d+)|) or die "Wrong timestamp: $last\n"; # e
+xtract values from the timestamp, with a bit of checking
$year = $year + 1900;
$last_time=POSIX::mktime($sec2,$min2,$hr2,$mday2,$mon2,$year2); # tran
+s form the timestamp into a unix-time (seconds since the epoch)
unless (defined $last_time) {die "Wrong timestamp2: $last\n$year, $yea
+r2"} # mktime will return undef if the date is not valid
I keep getting the error on Timestamp2..
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.