Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
11268 | obado | 1 | #!/bin/sh |
2 | |||
3 | # INPUT : $duration,$date_format |
||
4 | # returns the date it will be in $duration seconds, formated as $date_format |
||
5 | exec perl <<'EOF' |
||
6 | use strict; |
||
7 | use warnings; |
||
8 | use Time::Piece; |
||
9 | |||
10 | my ($duration,$date_format)=(0,"%Y-%m-%d - %T"); |
||
11 | |||
12 | if($ENV{'wims_exec_parm'}){ |
||
13 | my @params = split(',', $ENV{'wims_exec_parm'}); |
||
14 | $duration=$params[0]; |
||
15 | if($#params>0){$date_format=$params[1];} |
||
16 | } |
||
17 | |||
18 | my $Start = localtime; |
||
19 | my $End = $Start + $duration; |
||
20 | print $End->strftime($date_format)."\n"; |
||
21 | |||
22 | EOF |