perlquestion
ultibuzz
<p>Dear Monks,<br>
Im in need to do a report of calls per Timeframe, i will give some Infos what i mean.</p>
<p>what i have is the start time and the duration<br><br>
<b>Examples: format is yyyyddmmhh24miss;seconds</b><br>
20090302173742;362<br>
20090306185330;27<br>
20090302170758;6871<br>
20090301195442;35201<br>
<br>
Based on that data i need to put the duration in propper Timeframes, the Frames are:<br>
7-9<br>
9-18<br>
18-19<br>
19-7<br>
weekend<br><br><br>
The Result should look like this</p>
<table border=1>
<tr><td>Start Time</td><td>7-9</td><td>9-18</td><td>18-19</td><td>19-7</td><td>weekend</td></tr>
<tr><td>20090302173742</td><td>0</td><td>362</td><td>0</td><td>0</td><td>0</td></tr>
<tr><td>20090306185330</td><td>0</td><td>27</td><td>0</td><td>0</td><td>0</td></tr>
<tr><td>20090302170758</td><td>0</td><td>3122</td><td>3600</td><td>149</td><td>0</td></tr>
<tr><td>20090301195442</td><td>0</td><td>0</td><td>0</td><td>20483</td><td>14718</td></tr>
</table>
<p>The duration should be sorted to the Timeframes, and if a call is on a weekend but going into a monday,<br>
then the rest of the duration need to be sorted as well.<br><br>
Im at the Beginning of writing the script, <br>
i would Go with Date::Calc for the date calculations and a while duration > 0 loop with alot of IF's to split the duration into the propper slots.<br><br>
A hint how to make it better is much aprechiated<br><br>kd ultibuzz</p>