htmanning has asked for the wisdom of the Perl Monks concerning the following question:
I don't get how a time of 24:40 could be entered at all. Shouldn't 12:40 am be 00:40?sub Calc_Date_Vars { use DateTime qw( ); $dt = DateTime->now( time_zone => 'Pacific/Honolulu' ); $dateadded_time = $dt->strftime("%l:%M %P"); $dateadded_date = $dt->strftime("%b %e, %Y"); $ymd = $dt->ymd; $dateadded2 = $ymd; $hour = $dt->hour_1(); $min = $dt->min(); $hourmin = "$hour:$min"; }
The problem is I calculate the time in minutes (hour x 60 plus minutes) and subtract the last login from now. Then I do this:
if (($lastvisit eq "$dateadded2" && $nowhourmin < 10) { print "Online"; }
Well, right now the time is 19:42 on 1/5 but his entry says 1/5 24:40. 1/5 was yesterday for him so it's showing him as logged in even if he isn't. Shouldn't the time entered be the server time no matter where you login from? I'm having a brain fart here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Server time vs computer logging in
by huck (Prior) on Jan 06, 2017 at 00:59 UTC | |
by htmanning (Friar) on Jan 06, 2017 at 01:13 UTC | |
by huck (Prior) on Jan 06, 2017 at 01:18 UTC | |
|
Re: Server time vs computer logging in
by 1nickt (Canon) on Jan 06, 2017 at 02:07 UTC | |
|
Re: Server time vs computer logging in
by Anonymous Monk on Jan 06, 2017 at 01:32 UTC |