Data::Dumper is actually not needed, and it was just a handy way to display the result:
use strict; use warnings; my $offset = 3; display(reverse((localtime(time()))[0 .. 5])); display(reverse((localtime(time() + 24 * 3600 * $offset))[0 .. 5])); sub display { my @t = @_; printf("%d-%02d-%02d-%02d:%02d:%02d\n", $t[0] + 1900, $t[1] + 1, @ +t[2 .. 5]); }
In reply to Re^3: Calculate date with days
by pg
in thread Calculate date with days
by darrengan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |