| 1 | 1 | my @timevals; | |||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | return &to_char(@_) if (scalar(@_)); #ADDED 2003/12/15 TO MAKE INTO A GENERAL CALLABLE FUNCTION! | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 0 | my ($s) = $_[0]; | |||||||||||||||||||||||||||
| 6 | 0 | ▶ | my ($fmt) = $_[1] || 'dd-MON-rr'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$_[1] || 'dd-MON-rr'
MC/DC0%0/1
$_[1] || 'dd-MON-rr'
$_[1]
Truth table0%0/2
A
A= $_[1]
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 0 | $err = ''; | |||||||||||||||||||||||||||
| 9 | 0 | $rtnTime = ''; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 0 | @timevals = localtime($s); | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | foreach my $f (qw(month mon Month Mon MONTH MON)) | |||||||||||||||||||||||||||
| 14 | { | ||||||||||||||||||||||||||||
| 15 | 0 | $fmt =~ s/($f)/&{$f}($1)/eg; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | last if ($err) ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | 0 | foreach my $f (qw(ddd dd yyyy yy hh24 hh mi mm sssss ss rm rr)) | |||||||||||||||||||||||||||
| 19 | { | ||||||||||||||||||||||||||||
| 20 | 0 | $fmt =~ s/($f)/&{$f}($1)/egi; | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | last if ($err) ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | #$fmt =~ s/\b(a)([\.m]?)\b/&a($1).$2/egi; | ||||||||||||||||||||||||||||
| 25 | 0 | $fmt =~ s/\b([aApP])([\.[mM]?)\b/&{$1}.$2/eg; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | $fmt =~ s/([0\$BSCL]*)([9D\.\,GV]+)(\s*CR|PR|EEEE)/&fmt9($1,$2,$3)/eg; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | $rtnTime = $fmt; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub fmt9 | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
fmt9: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 0 | my ($pre, $val, $suf) = (@_); | |||||||||||||||||||||||||||
| 35 | 0 | my $l = length($val) + 1; | |||||||||||||||||||||||||||
| 36 | 0 | my $dec; | |||||||||||||||||||||||||||
| 37 | 0 | ▶ | $dec = length($1) if ($val =~ /[\.DV](\d+)/i); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | my $fmtstr = '%'; | |||||||||||||||||||||||||||
| 39 | 0 | $fmtstr .= $l; | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | $fmtstr .= '.'.$dec if ($dec); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if ($suf =~ /(E)EEE/i) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||
| 43 | 0 | $fmtstr .= $1; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | else | ||||||||||||||||||||||||||||
| 46 | { | ||||||||||||||||||||||||||||
| 47 | 0 | $fmtstr .= 'f'; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | 0 | my $t = sprintf($fmtstr, $s); | |||||||||||||||||||||||||||
| 50 | 0 | ▶ | $t =~ s/\s(\S)/\$$1/ if ($pre =~ /[C\$]/i); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | $t =~ s/(\s)([^\s\-])/$1\+$2/ if ($pre =~ /S/i); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | $t =~ s/[0\.\,]/ /g if ($pre =~ /B/i && $t =~ /^[\s0\.\+\-\,]+$/); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pre =~ /B/i and $t =~ /^[\s0\.\+\-\,]+$/
MC/DC0%0/2
$pre =~ /B/i and $t =~ /^[\s0\.\+\-\,]+$/
$pre =~ /B/i
$t =~ /^[\s0\.\+\-\,]+$/
Truth table0%0/3
A and B
A= $pre =~ /B/iB= $t =~ /^[\s0\.\+\-\,]+$/
| |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | $t =~ s/([\d\.\+\-]+)/ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | 0 | my ($one) = $1; | |||||||||||||||||||||||||||
| 55 | 0 | $one *= 10 ** $dec; | |||||||||||||||||||||||||||
| 56 | 0 | $one; | |||||||||||||||||||||||||||
| 57 | /e if ($val =~ /V/i); | ||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if ($suf =~ /(\s*cr)/i) | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 59 | { | ||||||||||||||||||||||||||||
| 60 | 0 | my ($one) = $1; | |||||||||||||||||||||||||||
| 61 | 0 | $t =~ s/\-(\S+)/$1$one/; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | elsif ($suf =~ /pr/i) | ||||||||||||||||||||||||||||
| 64 | { | ||||||||||||||||||||||||||||
| 65 | 0 | $t =~ s/(\-)(\S+)(\s?)/\<$2\>/; | |||||||||||||||||||||||||||
| 66 | 0 | $t =~ s/\$\</\<\$/; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | 0 | return $t; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | sub month | ||||||||||||||||||||||||||||
| 72 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
month: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 73 | 0 | my @months = ( | |||||||||||||||||||||||||||
| 74 | 'january ', 'february ', 'march ', 'april ', | ||||||||||||||||||||||||||||
| 75 | 'may ', 'june ', 'july ', 'august ', | ||||||||||||||||||||||||||||
| 76 | 'september', 'october ', 'november ', 'december '); | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | sub Month | ||||||||||||||||||||||||||||
| 82 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
Month: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 83 | 0 | my @months = ( | |||||||||||||||||||||||||||
| 84 | 'January ', 'February ', 'March ', 'April ', | ||||||||||||||||||||||||||||
| 85 | 'May ', 'June ', 'July ', 'August ', | ||||||||||||||||||||||||||||
| 86 | 'September', 'October ', 'November ', 'December '); | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 0 | my $indx = shift; | |||||||||||||||||||||||||||
| 89 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | sub MONTH | ||||||||||||||||||||||||||||
| 93 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
MONTH: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 94 | 0 | my @months = ( | |||||||||||||||||||||||||||
| 95 | 'JANUARY ', 'FEBRUARY ', 'MARCH ', 'APRIL ', | ||||||||||||||||||||||||||||
| 96 | 'MAY ', 'JUNE ', 'JULY ', 'AUGUST ', | ||||||||||||||||||||||||||||
| 97 | 'SEPTEMBER', 'OCTOBER ', 'NOVEMBER ', 'DECEMBER '); | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 0 | my $indx = shift; | |||||||||||||||||||||||||||
| 100 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | sub mon | ||||||||||||||||||||||||||||
| 104 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
mon: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 105 | 0 | my @months = ('jan', 'feb', 'mar', 'apr', 'may', 'jun', | |||||||||||||||||||||||||||
| 106 | 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'); | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 0 | my $indx = shift; | |||||||||||||||||||||||||||
| 109 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | sub Mon | ||||||||||||||||||||||||||||
| 113 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
Mon: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 114 | 1 | my @months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | |||||||||||||||||||||||||||
| 115 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | 1 | my $indx = shift; | |||||||||||||||||||||||||||
| 118 | 1 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | sub MON | ||||||||||||||||||||||||||||
| 122 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
MON: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 123 | 0 | my @months = ('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', | |||||||||||||||||||||||||||
| 124 | 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'); | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 0 | my $indx = shift; | |||||||||||||||||||||||||||
| 127 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | sub rm | ||||||||||||||||||||||||||||
| 131 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
rm: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 132 | 0 | my @months = ('i', 'ii', 'iii', 'iv', 'v', 'vi', | |||||||||||||||||||||||||||
| 133 | 'vii', 'viii', 'ix', 'x', 'xi', 'xii'); | ||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | 0 | my $indx = shift; | |||||||||||||||||||||||||||
| 136 | 0 | return $months[$timevals[4]]; | |||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | sub mm | ||||||||||||||||||||||||||||
| 140 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
mm: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 141 | 1 | my ($t) = $timevals[4] + 1; | |||||||||||||||||||||||||||
| 142 | 1 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 143 | 1 | return $t; | |||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | sub yyyy | ||||||||||||||||||||||||||||
| 147 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
yyyy: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 148 | 1 | return $timevals[5] + 1900; | |||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | sub yy | ||||||||||||||||||||||||||||
| 152 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
yy: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 153 | 0 | return &rr; | |||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | sub rr | ||||||||||||||||||||||||||||
| 157 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
rr: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 158 | 0 | my ($t) = $timevals[5]; | |||||||||||||||||||||||||||
| 159 | 0 | ▶ | $t -= 100 if ($t >= 100); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 160 | 0 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 161 | 0 | return $t; | |||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | #sub ddd | ||||||||||||||||||||||||||||
| 165 | #{ | ||||||||||||||||||||||||||||
| 166 | # return $mday; | ||||||||||||||||||||||||||||
| 167 | #} | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | sub dd | ||||||||||||||||||||||||||||
| 170 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
dd: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 171 | 1 | my ($t) = $timevals[3]; | |||||||||||||||||||||||||||
| 172 | 1 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 173 | 1 | return $t; | |||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | sub hh24 | ||||||||||||||||||||||||||||
| 177 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
hh24: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 178 | 0 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 179 | 0 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 180 | 0 | return $t; | |||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | sub hh | ||||||||||||||||||||||||||||
| 184 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
hh: called CC=4 SCAR=14.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 185 | 1 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 186 | 1 | ▶ | $t -= 12 if ($t >= 13); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 187 | 1 | ▶ | $t += 12 unless ($t); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 188 | 1 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 189 | 1 | return $t; | |||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | sub a | ||||||||||||||||||||||||||||
| 193 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
a: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 194 | 0 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 195 | 0 | ▶ | return 'a' if ($t < 12); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 196 | 0 | return 'p'; | |||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | sub p | ||||||||||||||||||||||||||||
| 200 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
p: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 201 | 0 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 202 | 0 | ▶ | return 'a' if ($t < 12); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 203 | 0 | return 'p'; | |||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | sub A | ||||||||||||||||||||||||||||
| 207 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
A: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 208 | 0 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 209 | 0 | ▶ | return 'A' if ($t < 12); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 210 | 0 | return 'P'; | |||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | sub P | ||||||||||||||||||||||||||||
| 214 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
P: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 215 | 0 | my ($t) = $timevals[2]; | |||||||||||||||||||||||||||
| 216 | 0 | ▶ | return 'A' if ($t < 12); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 217 | 0 | return 'P'; | |||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | sub mi | ||||||||||||||||||||||||||||
| 221 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
mi: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 222 | 0 | my ($t) = $timevals[1]; | |||||||||||||||||||||||||||
| 223 | 0 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 224 | 0 | return $t; | |||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | sub sssss | ||||||||||||||||||||||||||||
| 228 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
sssss: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 229 | 0 | return (($timevals[2]*3600) + ($timevals[1]*60) + $timevals[0]); | |||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | sub ss | ||||||||||||||||||||||||||||
| 233 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
ss: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 234 | 1 | my ($t) = $timevals[0]; | |||||||||||||||||||||||||||
| 235 | 1 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 236 | 1 | return $t; | |||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | sub ddd | ||||||||||||||||||||||||||||
| 240 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
ddd: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 241 | 0 | my ($t) = $timevals[7] + 1; | |||||||||||||||||||||||||||
| 242 | 0 | ▶ | $t = '0' . $t if ($t < 10); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 243 | 0 | return $t; | |||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | sub to_char | ||||||||||||||||||||||||||||
| 247 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
to_char: called CC=6 SCAR=18.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 248 | 1 | my ($s) = $_[0]; | |||||||||||||||||||||||||||
| 249 | 1 | ▶ | my ($fmt) = $_[1] || 'dd-MON-rr'; | ||||||||||||||||||||||||||
|
Condition50%1/2
$_[1] || 'dd-MON-rr'
MC/DC0%0/1
$_[1] || 'dd-MON-rr'
$_[1]
Truth table50%1/2
A
A= $_[1]
| |||||||||||||||||||||||||||||
| 250 | #print "<BR>TO_CHAR($s|$fmt)=\n"; | ||||||||||||||||||||||||||||
| 251 | 1 | $err = ''; | |||||||||||||||||||||||||||
| 252 | 1 | $rtnTime = ''; | |||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||
| 254 | 1 | @timevals = localtime($s); | |||||||||||||||||||||||||||
| 255 | #print "<BR>timevals=".join('|',@timevals)."=\n"; | ||||||||||||||||||||||||||||
| 256 | 1 | foreach my $f (qw(month mon Month Mon MONTH MON)) | |||||||||||||||||||||||||||
| 257 | { | ||||||||||||||||||||||||||||
| 258 | 6 | $fmt =~ s/($f)/&{$f}($1)/eg; | |||||||||||||||||||||||||||
| 259 | 6 | ▶ | last if ($err) ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||
| 261 | 1 | foreach my $f (qw(ddd dd yyyy yy hh24 hh mi mm sssss ss rm rr)) | |||||||||||||||||||||||||||
| 262 | { | ||||||||||||||||||||||||||||
| 263 | 12 | $fmt =~ s/($f)/&{$f}($1)/egi; | |||||||||||||||||||||||||||
| 264 | 12 | ▶ | last if ($err) ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||
| 267 | #$fmt =~ s/\b(a)([\.m]?)\b/&a($1).$2/egi; | ||||||||||||||||||||||||||||
| 268 | 0 | $fmt =~ s/\b([aApP])([\.[mM]?)\b/&{$1}.$2/eg; | |||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||
| 270 | 0 | $fmt =~ s/([0\$BSCL]*)([9D\.\,GV]+)(\s*CR|PR|EEEE)/&fmt9($1,$2,$3)/eg; | |||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||
| 272 | 1 | $rtnTime = $fmt; | |||||||||||||||||||||||||||
| 273 | #print "<BR>tochar returns =$rtnTime=\n"; | ||||||||||||||||||||||||||||
| 274 | 1 | return $rtnTime; | |||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||
| 277 | 0 | 1 | |||||||||||||||||||||||||||