I'd start with making that easier to extend (and maintain). The snippet uses the default (builtin) localtime function, not the one returning a hashref or an object:
sub timestamp { my @st = localtime (shift); return sprintf "%04d-%02d-%02dT%02d:%02d:%02d.000-0700", $st[5] + 1900, ++$st[4], @st[3,2,1,0]; } sub starttimestamp { return timestamp (time); } sub endtimestamp { return timestamp (time + (15 * 60)); } sub futuretimestamp { return timestamp (time + shift); } my $fts = futuretimestamp (162 * 60 * 60); # Stamp 162 hours ahead
This way, there is only one location that defines the required format and several easy ways to use that.
In reply to Re^3: Newbie: Request help on creating CSV using timestamp data
by Tux
in thread Newbie: Request help on creating CSV using timestamp data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |