Replacing your time with one here which should trigger the if branch (rather than the else) I am unable to reproduce your findings.
$ perl 1178137.pl The current time is Mon Dec 19 23:40:37 2016 The old time is Mon Dec 19 23:31:00 2016 Half an hour ago is Mon Dec 19 23:10:37 2016 Old time is within a half hour
If you think you have timezone (or DST) problems it is always best to output the epoch times as a diagnostic aid. I suggest you give that a try.
In reply to Re: Simple (I thought) time comparison?
by hippo
in thread Simple (I thought) time comparison?
by sjessie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |