Add 2 strings which represent the total time

Hi,
I have a column which stores the total duration of a session. I am retriving it as String, but I need to total the entire column. How can I achieve that. I am storing it in (hh:mm:SS) format.
Please do share your inputs.
Thanks,
Ajay.

Convert hh:mm:ss to seconds by StringTokenizer with delimiter :
Convert hh, mm, ss to int by parseInt();
total = 360*first + 60*second + third;

Similar Messages

  • How can I calculate the total time in java?

    Hello!
    I need to calculate the total time!
    For example I have start time:
              Format formatter1;
              Date date1 = new Date();
              formatter1 = new SimpleDateFormat("hh:mm:ss");
              String startTime = formatter1.format(date1);
              //startTime = "14:20:40";
    And I have finish time:
              Format formatter2;
              Date date2 = new Date();
              formatter2 = new SimpleDateFormat("hh:mm:ss");
              String finishTime = formatter2.format(date2);
              //finishTime = "08:30:55";
    So, after manually calculating, I get total time: "18:10:15"
    How can I calculate the total time in java? (Using formatter1 and formatter2 I suppose)
    What I need is to print "total 18:10:15"
    Thanks!

    800512 wrote:
    I did the following but, I think something is wrong here:
    I defined before: Date date1 = new Date(); Date date2 = new Date();
    And it should be exactly 5 seconds between them.
    I found delta between date1 and date2:
    Format formatter = new SimpleDateFormat("HH:mm:ss");
              long timeInMilliFromStart = date1.getTime() - date2.getTime() ;
              Date date3 = new Date(timeInMilliFromStart);
              String timeInSecFromStart = formatter.format(date3);
    and I get always
    //timeInSecFromStart = 02:00:05
    But it should be exactly 00:00:05.
    What can be a problem?Because, like I said, a Date measure an instant in time, not a duration. So when you have 5000 ms, and you turn that into a Date, that means 5 sec. after the epoch, which works out to 1/1/1970 00:00:05.000 GMT.
    As I mentioned, if you're not currently in GMT, then you have to set the TZ of the DateFormat to GMT. Right now, it's showing you the time in your TZ. If you included the date in your SimpleDateFormat, you'd see either 1/1/1970 or 12/31/1969, depending on which TZ you're in.
    Bottom line: You're trying to use these classes in a way they're not meant for, and while you can get the results you want for a limited set of inputs if you understand what these classes do and how to work with that, it's a brittle approach and comes with all kinds of caveats.

  • I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    Why not use an event
    Add a While Loop, inside the loop add the Event Sructure.
    Now in the event structure selecd the String Controls.value change event to
    react
    and the new value inside the event that you get,( connect to the String
    indicator box.
    On Sun, 10 Aug 2003 15:58:47 -0500 (CDT), WiltonFilho wrote:
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

  • Represent the real time localization and RFID

    Dear java friends
    Im student and I’m developing a RFID project using an active tags. My objective in this work is to represent the real time localization of the tags inside a specific plan by calculate the TDoA. Was easy the right the formula however I had hard time to create the plan and I don’t know what way I have to take. I m asking how can I represent my coordinate inside a real plan related to some area like house or factory for example. Can I use some cartography API as GEOTOOLS because they have the same principals? Can I convert the same principals used with the GPS mapping in the RFID plan representation?

    jschell wrote:
    jwenting wrote:
    Is there in fact anything to localise at all in the data the reader receives from the RFID chip?RFID is passive. The information is static. So location information would need to be produced from the reader.true. But I question the assumption that the information the reader receives from the RFID is in fact of a nature that requires localisation.
    It'll almost certainly be data that can do no more than facilitate a database lookup in order to retrieve the actual data (which may be of a nature that allows localisation of course).
    But that's not the reader's job. The RFID reader just reads the RFID and passes the data it retrieves to a processing application.
    It's just an interface, and should be kept as stupid as possible.
    That application can have a need to localise whatever results from processing the data it gets from the reader (or more likely pass it on to some other system for displaying it to an end user, and only at that stage is localisation called for).
    For example, a reader might read a pallet number in a warehouse, and send it to the central processing system to look up the pallet content.
    This cargo manifest is then displayed on a palmtop computer belonging to the person using the reader.
    The reader itself does not need to know whether the palmtop needs to show English, Russian, or Japanese, neither does the backend database.
    Instead the manifest is a series of product codes (and number of items/volume indications) which the user interface application uses to request localised product names from the product database.

  • Is there an add-on program, which assumes the directory structure of a Windows PC with subfolders?

    Hi all,
    Is there an add-on program, which assumes the directory structure of a Windows PC with subfolders?
    So that the playlists are created with all the directories and subdirectories.
    I would like the Music folder
    and all its subdirectories
    drag into iTunes.
    Then should the songs in iTunes and in the Iphone geanu be designed with the same directory wiht subdirectories structure.
    Example:
    G:\1 wav+mp3\1 Alles\2 Deutsches\Die Prinzen\Album Die Prinzen - Das Leben ist grausam\AlbumArtSmall.jpg
    G:\1 wav+mp3\1 Alles\2 Deutsches\Die Prinzen\Album Die Prinzen - Das Leben ist grausam\Betriebsdirektor - Das Leben Ist Grausam - die Prinzen - 05 - .mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Die Prinzen\Album Die Prinzen - Das Leben ist grausam\Blaues Blut - Das Leben Ist Grausam - die Prinzen - 07 - .mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Die Prinzen\Album Die Prinzen - Das Leben ist grausam\desktop.ini
    G:\1 wav+mp3\1 Alles\2 Deutsches\Grönemeyer\Zwölf\Herbert_Grönemeyer_-_12_[2007]_-brandneu-_[found-on-www-bitreactor-to].to rrent
    G:\1 wav+mp3\1 Alles\2 Deutsches\Grönemeyer\Zwölf\Lied 01 - Ein Stück vom Himmel.mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Grönemeyer\Zwölf\Lied 02 - Kopf hoch,tanzen.mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Grönemeyer\Zwölf\Lied 03 - Du bist die.mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Hannes Wader\ Dass nichts bleibt wie es war\Rohr im Wind - Dass nichts bleibt wie es war - Hannes Wader - 07.mp3
    G:\1 wav+mp3\1 Alles\2 Deutsches\Hannes Wader\ Dass nichts bleibt wie es war\Schon so lang - Dass nichts bleibt wie es war - Hannes Wader - 02.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Allerlei
    G:\1 wav+mp3\1 Alles\3 Song\Allerlei\(Everything I Do) I Do It For You - Bryan Adams - Best of Me (Ecopac) - 10.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Allerlei\(Sittin' on) the dock of the bay - Otis Redding - (Sittin' on) the Dock of the Bay - 01.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Allerlei\~ Change Is Gonna Come - The Neville Brothers - Yellow Moon - 01.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Boney M. - Daddy Cool\Baby, Do You Wanna Bump - Daddy Cool - Boney M. - 06.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Boney M. - Daddy Cool\Barbarella Fortuneteller - Daddy Cool - Boney M. - 15.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Boney M. - Daddy Cool\Belfast - Daddy Cool - Boney M. - 04.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Elvis Presley - Definitive Country Album
    G:\1 wav+mp3\1 Alles\3 Song\Elvis Presley - Definitive Country Album\AlbumArtSmall.jpg
    G:\1 wav+mp3\1 Alles\3 Song\Elvis Presley - Definitive Country Album\Always On My Mind - Definitive Country Album - Elvis Presley - 03.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Elvis Presley - Definitive Country Album\Burning Love - Definitive Country Album - Elvis Presley - 09.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Elvis Presley - Definitive Country Album\Don't Cry Daddy - Definitive Country Album - Elvis Presley - 15.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Flying Pickets\Every Little Thing She Does-Flying Pickets - Flying Pickets.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Flying Pickets\Folder.jpg
    G:\1 wav+mp3\1 Alles\3 Song\Flying Pickets\goodnight sweethart - flying pickets - flying pickets .mp3
    G:\1 wav+mp3\1 Alles\3 Song\Flying Pickets\Groovin'-Flying Pickets - Flying Pickets.mp3
    G:\1 wav+mp3\1 Alles\3 Song\Flying Pickets\I Got You Babe - Flying Pickets - Flying Pickets.mp3
    G:\1 wav+mp3\1 Alles\4 Instrumental\Allerlei\Classical - Franz Liszt - Liebestraum piano - Franz Liszt - Liebestraum piano.mp3
    G:\1 wav+mp3\1 Alles\4 Instrumental\Allerlei\Classical Guitar - Greensleeves - Greensleeves.mp3
    G:\1 wav+mp3\1 Alles\4 Instrumental\Allerlei\Classique - Schumann - Carnaval, Chopin - Schumann - Carnaval, Chopin.mp3
    G:\1 wav+mp3\1 Alles\4 Instrumental\Allerlei\Crown Chakra - Tony O'Connor - Tony O'Connor.mp3
    G:\1 wav+mp3\1 Alles\4 Instrumental\Allerlei\Dallas - TV 70's & 80's.mp3
    usw.
    Is there a program led?
    Thank you very much
    frank

    deggie wrote:
    No, as there is no such file management system in iOS.
    I do not understand this..
    In iTunes I can create folders and subfolders.
    Please look.
    I would like to drag the folder "1 All" in iTunes.
    There should also then the folder structure are taken
                       iTunes                                                 Windows 7 Explorer
                    Folder in Folder                                        Folder in Folder
    Thank you very much
    Frank

  • How to insert, as an input variable within formula, the total time window on scope?

    How to insert, as an input variable within formula, the total time window on scope (i.e. 20ms/div x 10 div = 200ms)?
    BELOW IS AN EXAMPLE OF ISSUE:
    FORMULA FOR ACTION INTEGRAL:
    STATISTICS:
    Input variable: DPO4034(CH1);
    Check Box: number of samples.
    FORMULA
    Input variable 0: DPO4034(CH1); alias: x0
    Input variable 1: "Total Time Window on Scope???"; alias: x1
    Input variable 2: Number of Samples (CH1); alias: x2
    Under Operation Setup: Formula
    Y= (x0^2)*(x1/x2)
    Output: Processed Data 1 (CH1)
    THEN USING STATISTICS:
    Input signal: Processed Data 1 (CH1)
    Check Box: SUM
    Output: CH1 Action Integral [A^2s]
    Solved!
    Go to Solution.

    Hi again Catherine,
    I have now added another TekScope (TDS3032B) along with the DPO4034 and run the same work-around on the TDS3032B using CH1 as the "real" signal channel and CH2 as the "burst width" channel. However, the value returned for CH2 is nominally 99E+36 (min 99E+36, max 99E+36) with very few retrievals of correct burst width (~200ms). Seems the SignalExpress program is unable to consistently retrieve from TDS3032B the actual burst width (scope's time scale/window) and defaults to 99E+36 value. Any ideas on what is occurring and how to make it work? Attached are some screen captures to help guide discussion.
    Regards,
    Michael
    Attachments:
    TDS3032B - incorrect burst width.png ‏301 KB
    TDS3032B - correct burst width.png ‏287 KB
    DPO4034 - always correct burst width.png ‏302 KB

  • Which is the maximum time you can have in a video?

    which is the maximum time you can have in a video?

    Hello There,
    Let me start off by stating that I'm no professional nor do I have the extensive knowledge to tell you exactly what wrong. What I know is from plain research I did when I was trying to decide wether to upgrade my macbook 6,1 (late 2009) model to 4GB or 8GB. Which by the way, what is your MacBook ID? 4,1 or 5,1  or  6,1
    What I found is that Apple says that my Macbook 6,1 can only go up to 4GB of RAM but it can actually go up to 8GB. From the explanation they gave I understood that Apple, states what that particular machine can be upgraded to at the current time that model is manufactured.
    I learned a lot mainly from different forums on the internet and the comments of people.
    Try this web site macsales.com and see what they suggest you upgrade yours to.
    The web site also helps you find you exact MacBook model to be able to upgrade accordingly. Heck you may also get a tech on a chat line and he can tell you what's wrong with your current RAM.
    But again find out what is your MacBook model ID. See the link below:
    http://eshop.macsales.com/shop/memory/Apple_MacBook_MacBook_Pro/Upgrade/Macbook_ selector
    -Moe

  • ToString() and new String(),which is the better?

    now,there is very big StringBuffer sb,i want convert it to String s,which is the better:
    s=sb.toString();
    s=new String(sb);
    Thanks.

    now,there is very big StringBuffer sb,i want convert
    it to String s,which is the better:
    s=sb.toString();
    s=new String(sb);
    Thanks.this is the implementation advice for
    toString(StringBuffer)
    This method can be coded so as to create a new String object
    without allocating new memory to hold a copy of the character sequence. Instead, the string
    can share the memory used by the string buffer. Any subsequent operation that alters the
    content or capacity of the string buffer must then make a copy of the internal buffer at that
    time. This strategy is effective for reducing the amount of memory allocated by a string
    concatenation operation when it is implemented using a string buffer.
    so decide urself
    regards
    robert

  • How to get the total time spent by a Portal User for a given Date?

    Hello,
    We need to develop a Daily Audit Track Report that displays
    the Users logged into our System for a given day and the total login duration in Hours( should include all the
    Login-Logouts of a given date).
    While Portal30_SSO.WWSSO_AUDIT_LOG_TABLE$ can help me get the Users login to Portal for a day, there is no Login/Logout periods in it.
    Any help would be appreciated.
    Thanks
    Madhav

    You may want to consult with the view WWLOG_ACTIVITY_LOGS. Not sure how your environment is configured, but ours includes two WWLOG_ACTIVITY_LOG tables (1 & 2). These tables purge themselves based on your configuration. In other words, Portal will log activity in WWLOG_ACTIVITY_LOG1$ for a certain period of time, then switch to WWLOG_ACTIVITY_LOG2$ while purging the first one. You can specify the purge timetable in the Adminster tab of the Admin page (under Global Settings). If you just key on just 1 log table, you're logs may someday go blank.
    The actions used are 'login' and 'logout'. You can link the actions using the key_1 and key_2 columns of the view. From our current experience, Portal does not account for users that simply close the browser. In other words, we have not been able to get a log event for the action 'logout' for the same key_2 value if someone does this.

  • Tables which stores the total balances of customer and vendors

    Hi
    Can any one let me know in which table does the total balances of the customer and Vendors are stored.
    except these LFC1, KNC1
    Thanks and Regards
    Srihari Boll
    Edited by: Srihari Bolla on Dec 4, 2008 4:21 PM

    "normal" balances are in the tables you mentioned, the special G/L balances you'll find in LFC3 and KNC3 tables. There is nothing else!

  • I am trying to write a heartbeat program which takes the current time and writes

    I am trying to write a VI that gets the current time and writes it to an XML file in this format.  YYYY-MM-DDThh:mm:ss[.s][Z|(+|-)hh:mm]
    I cant seem to get the operators on the format date/time string vi to work for concatenating the "-" between the year and month
    Anybody know how to do this one?

    You should not need to use special operaors for the format date/time string, the format should simply be"%Y-%m-%d"

  • Finding the total time or total frames for FLV?

    Is there some properties box somewhere that will tell me the
    total number of frames or total time for an FLV? I can see the time
    after I encode the files, but that information doesn't seem to
    stick around.
    Thanks.

    You can see the time length of an FLV clip in your Library by
    right clicking the file name and chosing Properties from the menu.
    Hope that helps!

  • In FF8.01 how can I prevent the add-on check which pops up each time I start the program?

    In Firefox 8.01, each time I start Firefox, a box pops up indicating the program is checking to see if my addons are compatible. There are currently 3 which are not, and this box simply delays the program start to tell me the same thing every time I start Firefox. Most annoying. Is there a way I can prevent this box from appearing, or reduce it to once a week or once a month?

    FF9 does not seem to have the automatic plugin check, so the problem appears solved. Thanks !!

  • Solve 'String Equation' at the run time

    Can any one help me how to solve String Equation. I get equation and its respective values from database table and i want to solve the equation at run time.
    Ex: (round (x * y) / 1000) /1000
    Please help me as i am new to Java envionment.
    Thanks
    Raveesh

    For a small footprint Java interpreter have a look at BeanShell.
    kind regards,
    Jos

  • Control the total time for a quiz

    I find in Captivate 4 it is possible set time limit for individual question. However, it is more useful for me to set a time limit for the whole quiz. I cannot find such setting in quiz preference. Can we do that without any customization by AS coding?

    It is possible to set a time limit in CP-quizzes, if you are creating a SCORM-object (for a LMS) by settings in the Manifest file: under SCO as you can see in this image:
    But honestly I believe it is much better to set time limits in the LMS itself (supposing you are deploying the quiz through a LMS).
    Lilybiri

Maybe you are looking for