sauravrout has asked for the wisdom of the Perl Monks concerning the following question:
I am changing the days with hms, but it is giving me the error. Please some check this and let me know where I am doing the mistake. error: Can't call method "hms" on an undefined value at timediff line 7. Note that I dont have Date::Calc installed in my production systems.use Time::Piece; use Time::Seconds; $before = Time::Piece->strptime("2001/01/01", "%Y/%m/%d"); $now = localtime; $diff = $now - $before; print int($diff->days), " days since $before\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Time:Piece help
by marto (Cardinal) on Apr 24, 2014 at 15:47 UTC | |
|
Re: Time:Piece help
by poj (Abbot) on Apr 24, 2014 at 16:25 UTC | |
|
Re: Time:Piece help
by runrig (Abbot) on Apr 24, 2014 at 16:10 UTC | |
|
Re: Time:Piece help
by Anonymous Monk on Apr 24, 2014 at 16:07 UTC | |
by Anonymous Monk on Apr 24, 2014 at 16:15 UTC | |
by runrig (Abbot) on Jun 02, 2014 at 23:36 UTC |