Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Dear Monks,
Im in need to do a report of calls per Timeframe, i will give some Infos what i mean.

what i have is the start time and the duration

Examples: format is yyyyddmmhh24miss;seconds
20090302173742;362
20090306185330;27
20090302170758;6871
20090301195442;35201

Based on that data i need to put the duration in propper Timeframes, the Frames are:
7-9
9-18
18-19
19-7
weekend


The Result should look like this

Start Time7-99-1818-1919-7weekend
200903021737420362000
20090306185330027000
200903021707580312236001490
200903011954420002048314718

The duration should be sorted to the Timeframes, and if a call is on a weekend but going into a monday,
then the rest of the duration need to be sorted as well.

Im at the Beginning of writing the script,
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.

A hint how to make it better is much aprechiated

kd ultibuzz


In reply to Sorting Call durations into Timeframes by ultibuzz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (6)
    As of 2014-12-27 14:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (177 votes), past polls