Time conversion...any other way of doing same thing?

Class field: totalSeconds of type String;
Method to convert String appropriate time display of format h/mm/ss
Created a method, it works find, but since i'm new i was wondering whether there is slightly different maybe easier or smarter way of doing the same thing?
Here's my method's code:
StringBuilder timeDisplay = new StringBuilder("");
    //Converting String to int
    int totalTime = Integer.valueOf(trackDuration).intValue();
    int temp;
/* HOURS *********************************/
    temp = (totalTime/3600);
    totalTime = (totalTime - (temp*3600));
            timeDisplay.append(temp+":");       
/* MINUTES *********************************/
    temp = (totalTime/60);
    totalTime = (totalTime-(temp*60));
    if (temp < 10)
        timeDisplay.append("0"+temp+":");
    else
            timeDisplay.append(temp+":");       
/* SECONDS *********************************/
    if (totalTime < 10)
            timeDisplay.append("0"+totalTime);
    else
            timeDisplay.append(totalTime);
    return timeDisplay.toString();
   

c00ler wrote:
Hey, thank you for the response atul, forgot to say that i'm not dealing with Time of the day, general time such as movie playing time.Time is represented internally as 1/1000 sec since a base time. Your durations can also measured this way, the only difference is that the base isn't Jan 1, 1970, it's whenever you started timing. So you can use SimpleDateFormat to format these values, as long as the duration is less than a year. You can also you a GregorianCalendar to take these values apart.

Similar Messages

  • 3G still won't turn off after hitting home and sleep button at same time. Any other ways to try?

    3G still won't turn off after hitting home and sleep button at same time. Any other ways to try it?

    And when you held them neither the red Off slider nor the Apple logo appeared?
    If not then your sleep button is broken, you will need to get it serviced.

  • Is there is any other way which works same as berkeley db...

    hi every one,
    what i am trying to do is in a webpage of our web site we are have a news section so all those news are changing everyday so we are actually trying to build a database with the help of berkeley db sothat the search for our web site becomes fast to access.
    we will flush the updated data in the data base every day for news only,
    as we know berkeley db is one of fatest method to do these kind of things..
    but my boss is saying find out another method to do this thing...
    so pls guide me...
    thanks & Regards
    AT

    Hi,
    This is still a little vague to me but here is a suggestion:
    I suggest you read the getting started guides starting with Berkeley DB Java Edtion and possibly Berkeley DB and investigate whether you think this is a good fit based on your requirements.
    Are you writing your application in Java?
    http://www.oracle.com/technology/documentation/berkeley-db/je/GettingStartedGuide/applicationoverview.html
    The above is the Getting Started Guide for Berkeley DB Java Edtion. Below is a pointer to the documentation set:
    http://www.oracle.com/technology/documentation/berkeley-db/je/index.html
    Ron

  • Every time I try to restore my ipod it downloads the software then it says its processing it, then it says it cant download it right now.  Is there any other way to unlock a locked ipod touch without the lockcode?

    My son can't remember his passcode for his iPod touch and for some reason every time I try to restore it, the software gets updated and it starts processing it then it says there was an error and to try again later.  Later, it still does and says the same thing.  Is there any other way to unlock it without the passcode?

    The only way to clear off the passcode is to restore the device.  You could always try the restore process on another computer that has iTunes just to get the iPod working again, then you could plug it back into your comptuer to sync all of his content back on the iPod.

  • HT1430 My ipad mini is frozen in an app and the home button is stuck.  Pressing down on the sleep/wake button does not give me the red slider to turn the ipad off.  Is there any other way I can reset?

    My ipad mini is frozen in an app and the home button is stuck.  Pressing the wake/sleep button does not bring up the red slider to turn the ipad off. Is there any other way I can reset the ipad?  Can I remove the battery? and then put it back in?

    barbarafromnl wrote:
      Can I remove the battery?
    No the battery is non removable.
    Try a Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • HT1515 Does airport express have auto on/off schedule feature? Or any other ways to turn it on/off automatically.

    Does airport express have auto on/off schedule feature? Or any other ways to turn it on/off automatically.

    The Timed Access feature of the AirPort Express will allow you set the specific times that each wireless device will be allowed to connect to the wireless network each day.
    However, this feature cannot be used to "turn on", or "turn off" the AirPort Express device.

  • Western Digital My Book World EditionI have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way i get the message 'There was a proble

    I have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way I get the message 'There was a problem connecting to the server "MybookWorld.local" The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem'
    It is a brand new iMac and running Lion OSX
    Any ideas on how to solve would be gratefully received?

    Followed the directions on this page and it worked!
    http://forums.macrumors.com/showthread.php?t=1102423
    Part One - Turn on SSH (in the admin panel)
    [1] Go to to http://mybookworld.local
    [2] login: username will be admin, password will be whatever you have setup. If you can't remember it should be in your Mac OS X keychain (Utilities > Keychain Access, search for "mybookworld"). If you have not changed if from the default the password will be admin as well.
    [3] Switch to advanced mode.
    [4] From the System tab, pick Advanced.
    [5] Enable SSH Access, and click submit.
    [6] Click on the network tab and then the LAN button
    [7] Make a note of the IP address
    Small, maybe obvious, but nevertheless important point: For the install to work, your NAS needs to be connected to a router with internet access.
    Part Two - Install netatalk2.2
    [8] Open Terminal.app (Utilities > Terminal)
    [9] Enter the following command (substitute in 127.0.0.1 for the actual IP address you noted down in step 7), then hit return:
    Code: 
    ssh [email protected]
    [10] When prompted, enter the ssh password (will be welc0me).
    [11] You are now going to download the installer. Enter the following command, then hit return:
    Code: 
    wget http://mybookworld.wikidot.com/local--files/netatalk2-2-on-whitelight/install_netatalk.sh -O install_netatalk.sh
    [12] Once completed, you will need to run the installer. Type:
    Code: 
    sh install_netatalk.sh
    [13] You will be asked a number of question during install, answer yes to all. When asked about the "DHX2 login process", I opted to install the modified version, so I can confirm it works.
    [14] Once the box has restarted, you should be able to connect to your afp shares and continue to use Time Machine.

  • My wifi button is frezon and I tried turning my phone off for a period of time and reset my phone but the button is still frezon it want slide over to turn on my wifi. Is there any other way to fix without going to apple to get it fixed?

    My wifi button is frezon and I tried turning my phone off for a period of time and reset my phone but the button is still frezon it want slide over to turn on my wifi. Is there any other way to fix without going to apple to get it fixed?

    Hey Posada143, You can still try the rice thing, but do not expect much, as roaminggnome has stated. The rice only works if you do it ASAP and leave the iPod off-- do not attempt use, turn on or charge until it is completely dried out. This is probably academic at this point but remember this for the next time: The drying can take 10 days. You put the uncooked rice and iPod in a sealed bag, change the rice every couple of days. This creates a low humidity environment and draws the moisture out of the iPod, but it takes time. Turn your iPod on to earlier, and you run the risk of shorting out, damaging the components inside. Even if done correctly it can spotty. If you do get the iPod to work (and this may require Resetting, Restoring or attempting to place it in DFU recover mode) the first thing you do is make backups, because you never know how long it will continue to work. As for your pictures, if you can't get your iPod to work, you can try data retrieval companies, however; there is no guaranty it will work and it tends to be very expensive. In the future get in the habit of as making backups, because you just don't know. And invest in and use a water tight case. Hope this helps, Good luck. Cheers.

  • The volume up button of my iphone 5 is not working and i can barelly listen my conversations, is there any other way that let me raise the volume?

    The volume up button of my iphone 5 is not working and i can barelly listen my conversations, is there any other way that let me raise the volume?

    Yes go to settings, general, accessability and turn on assisive touch. A little square will appear, click it click more
    (the arrow) and select volume up. For more information tell me.

  • Is there any other way to  limit the data a user can see

    We are using Discoverer 10.2.xxx
    We are running it against an Oracle applications database but we do not have Discoverer integrated with the apps. I have created database users for discoverer and granted access to the data at the db level.
    We have about 40 salesreps and we only want each rep to see their own data. We have a high turn over with the reps
    For now, I have created the row level security in that folder in my eul. If the username = XXXX then Salesrep = XXXXX
    OR
    If username = YYYY then DSM = YYYY
    etc.. This goes on for about 40 users We have 3 levels of "users" - Salesrep, DSM or RSM (District or Region sales manager)
    These users are setup in my apps and I can write a database procedure to select their salesrep name based on their username.
    Is there any other way to limit the data that the salesreps can see ?
    Possibly with a stored procedure some way?
    Thanks
    Angie

    At a previous client's, I had created a system not too unlike what you're describing.
    Basically, I created an Oracle table that stored information concerning the salesperson as in Oracle Apps the data was not reliable for what they were doing (ie: with adding Apps modules, sometimes salesperson data was there, but with say, CRM, it was in another place, etc.).
    So, since this table was going to be used for driving everything about a salesperson (commissions, who they report to, when they started, territory, when / if they moved territories and/or manager, etc, etc.) I put lots of good stuff in it that would make life easier for them.
    The end user in charge of all this had was given a Form to add, edit, delete all this good stuff and they were happy.
    When it came time for security, it worked like a charm in that I used the concept of the BIS views where a user has an apps id associated to them and all data was filtered by that id. All I really had to do was to create this view that simply filtered data to that user's id. Then whenever I had a Discoverer report for salespeople, managers, etc. I just made sure the folder used had a join to this filtering view and I chose an item from the filtering view and all worked fine. All Discoverer reports only returned row level information for the salesperson who ran it.
    Likewise, the same Oracle table was queried by another security view that only brought back the same IDs for the salespeople associated to each manager. When this simple view was joined to any sales Discoverer folder (and used in Disco), it limited all data to the salespeople the manager was responsible for.
    Obviously this is just an overview and would take pages to explain, but essentially, if you can associate some kind of unique ID to each salesperson (I used the one returned in BIS views when someone logs into Apps, but you could just assign a different in your case), then you can create a view that filters to that id. Then when that view is brought into the EUL and joined to any other folder in the sales area (and you choose a column from the security view), you'll have what you're referring to - row level security for all salespeople and managers.
    When it works - it sure does look impressive.
    Russ

  • I locked my ipad and cant remember my 4 digit code to unlock it.  Can I unlock it any other way?

    I locked my ipad awhile ago and now I can't remember my 4 digit code to unlock it.  Can I unlock it any other way? Can I find my password anywhere on the cloud?

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • HT1430 Is there any other way to reset my ipod touch? I am asking because my home button is broken.

    Is there any other way to reset my ipod touch? I am asking because my home button is broken.

    If you mean this
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    then no
    To place the iPod in recovery mode yo can use:
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    for a PC
    and
    The Firmware Umbrella - TinyUmbrella
    For a PC or MAC

  • HT1933 Following the instructions above, I'm constantly redirected to this help page rather than receiving any drop down list to select what my problem is. Are there any other ways to report issues with purchases?

    Following the instructions for reporting an issue with a purchase problem, when selecting "report a probelm", I am not provided with a drop down list, I am redirected to the help page instead.
    Is there any other way to report an issue where the app owner has taken the funds twice for the same product at literally the same time?

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • IMac (2009) HD needs repair. Smartdrive is faulty, is there any other way ? (more details in post)

    I have an iMac 2009 Model running MacOS 10.6 to Core 2 Duo. From few months the disk utility and SMART status tells me to repair the HD using Disk Utility while boot. Now, my problem is that the super drive is dead, I had it replaced earlier but it died again, which means I can't use the CD to access Disk Utility during Boot Process. So,
    Is there any other way I can repair my Disk ?
    Is there a way to figure out if it is even repairable or my HD is just getting slow death.
    I might be upgrading to OSX Mavericks coming next month, so does it makes sense to wait & do a format/clean install at that time ?
    And, finally If i have to get the HD replaced, do third party drives from Segate, WD work well ? Or I should stick to what Apple Store provides ? Asking because here there is a major difference in price of both.
    Thanks!

    Once you get a S.M.A.R.T error the drive is failing and needs to be replaced. Nothing you can do to repair it. Once a drive starts to fail it can never be repaired to a point you can trust it.

Maybe you are looking for

  • Officejet 4500, Only printing header, not printing text in body of any document.

    Cannot get Officejet 4500 to print any thing other than headers on any document. Nothing in the body of any document is printing. Full ink cartridges, set for grayscale only. Does print test pages and is connected to my wireless network. Any help wou

  • Folio Builder doesn't open

    When I go to Window > Extensions in my InDesign CS5.5 (Mac), Foilo Builder is there but absolutely nothing happens when I try to select it. All other extensions there open up, but not Folio Builder. I have uninstalled Folio Producer tools, the Folio

  • How to turn over camera-images?

    Except for photo's I can make short film-shoots with my Fuji Finepix camera. When I import the images in Iphoto, it's not possible to turn-over the video-file, different then photo's. When I play the movie in Iphoto, or in Imovie, the video remains i

  • CDC in not started in the current context

    Dear All, I have performed all steps successfully for change data capture based on Mark Ritman article (http://www.oracle.com/technology/pub/articles/rittman-odi.html) with no errors. For some days everything worked fine but suddenly CDC stopped. The

  • I just bought the photography special (photoshop and lightroom) along with a Creative Cloud....

    ...and I can't find a redemption code. Photoshop and Lightroom were downloaded from Creative Cloud. None of the help guides from Adobe are answering my question. If anyone can help - THANKS