Converting millisecs to min and sec

I have to turn milliseconds into minutes and seconds for an
extra I am using. (Unfortunately the one command that I really need
only does TMSF (Track, minutes, seconds, frame). Everything else
uses milliseconds. So say I have 164000 milliseconds, that's 2.73
minutes. I need to take the 2 and put it assign it a variable then
I need to take the .73 and turn it into seconds, that 43.8 (44)
seconds. And I need to assign that a variable. So that I can get my
variables into
dmm_CDExtPlayFromTMSF(gTrack, gMin, gSec, 0)
Don't worry about the last number (frame), I don't know what
that's all about yet.
Here is my sad start
--gMark is the milliseconds
gMin = gMark/60000 (and ignore anything after the decimal
point WITHOUT ROUNDING UP OR DOWN)
gSec = ??
Basically, I want to parse not round the result of
gMark/60000
Can anyone show me the way to do this?

Thank you. That got me my integers, but now I get an error
message:
integer expected
dmm_CDExtPlayFromTMSF(gTrack,gMin,gSec,0)
1
Well last I checked 1 is an integer. It's not "1".
Here is the full script:
global gTrack, gMark, gMin, gSec
on mousewithin
set the moveablesprite of Sprite 9 to true
cursor 293
ConvertFromMillSecs
ScrubMusic
end
on MouseDown
dmm_CDExtPause()
end
on ConvertFromMillSecs
vSeconds = gMark / 1000
vMinutes = vSeconds / 60
vHours = vMinutes / 60
vMinutes = vMinutes mod 60
vSeconds = vSeconds mod 60
if vHours then
if vMinutes < 10 then
vMinutes = "0"&vMinutes
end if
vString = vHours&":"&vMinutes&":"
else
vString = vMinutes&":"
end if
if vSeconds < 10 then
put "0"&vSeconds after vString
else
put vSeconds after vString
end if
the itemDelimiter = ":"
tMin = vString.item[1]
tSec = vString.item[2]
the floatPrecision = 0
gMin = float(tMin)
gSec = float(tSec)
return vString
end
on mouseUp
dmm_CDExtPlayFromTMSF(gTrack,gMin,gSec,0)
end
It doesn't mind the gTrack which is a variable for an
integer. So why not gMin, or gSec?

Similar Messages

  • Converting seconds to Days,Hours,mins and secs

    Hi gurus,
    I have a metric in seconds , which is a box uptime . I want to convert that into Days,hours , mins and secs .How can I do that ?
    For example , If I have 433500 secs , I should show it as 5days 00:25:00 or in some meaningful format . Can anyone help me out ?
    Thanks,

    Hi,
    Refer thinks,
    Re: seconds to hh:mm:ss format
    OBIEE 11g - Change seconds to DD HH:MM:SS format
    Deva

  • How to configure JSpinner to accept number of hours (with mins and secs)

    I'm having a problem trying to figure out a simple way to enable a JSpinner to do allow the input in this format:
    n hours : n minutes : n seconds
    ex: 100 : 0 : 0, 1:59:59, 25:30:00
    Where n hours could be from 0-n (not restricted by 24 hours) and minutes and seconds are, of course, < 60. That is, I can enter number of hours, not a date, or a specific time in a day.
    I'm thinking the only way to do this is with a custom spinner model and custom editor? Or is there a simple way I can make the date model in spinner to allow me to do this?
    Thanks

    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Test2 extends JFrame {
      public Test2() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.setLayout(new FlowLayout());
        content.add(new MySpinner());
        setSize(300, 300);
        setVisible(true);
      public static void main(String args[]) { new Test2(); }
    class MySpinner extends JSpinner {
      public MySpinner() {
        setModel(new SpinnerDateModel(
          new GregorianCalendar(2004,0,1,0,0,0).getTime(),
          null, null, Calendar.DAY_OF_YEAR));
        setEditor(new DateEditor(this,"HH:mm:ss"));
    }???

  • Converting seconds to hrs, and minute

    I have never used function, is there a way to convert without using the declare... 
    Hi, 
    I have three columns, hour(s), min(s), sec(s)
    I can add it up, but will like to convert it into. hrs, mins and sec.
    this is how, i am adding it up into seconds.
    SELECT ((TotalTimeSpentHrs*60*60)+(TotalTimeSpentMin*60)+(TotalTimeSpentSec))AS totaltime
    FROM EST1
    how can I convert it. thanks

    use a function like this
    CREATE FUNCTION GetTimeParts
    @Seconds int
    RETURNS TABLE
    AS
    RETURN
    SELECT @Seconds/3600 AS HourPart,
    (@Seconds%3600)/60 AS MinutePart,
    (@Seconds%60) AS SecondPart
    GO
    Then we can invoke it like
    SELECT * FROM dbo.GetTimeParts(144072)
    which means 144072 seconds equivalent to 
    HourPart MinutePart SecondPart
    40 1 12
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page
    i get it , what of if i want to populate a column in a table with the result, what variable will a pass into 
    SELECT * FROM dbo.GetTimeParts(xxxxxxx)say the column name is timespent
    What you asked for was 3 columns in output. How do you store it in a single column?
    Or do you mean you want single value as xx hours yy minutes zz seconds?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page
    yes i mean, mean you want single value as xx hours yy minutes zz seconds?

  • Why does it take iMovie longer to import video than the length of the video? For example- it took 2 mins and 15 secs to import 2 mins and 4 secs of video...

    why does it take iMovie longer to import video than the length of the video? For example- it took 2 mins and 15 secs to import 2 mins and 4 secs of video...

    It's not like playing a tape. It has to convert it from whatever format you currently have into a codec suitable for editing (Apple Intermediate). This will take longer or shorter depending how compressed your original format is, and on the ability of your CPUs to catch up.
    Matt

  • I just purchased a new mac mini and would like to use my old dell monitor. I tried a HD to VGA adapter converter,it plugs in, but nothing shows on the monitor. Any suggestions? Thanks

    I just purchased a new mac mini and would like to use my old dell monitor. I tried a HD to VGA adapter converter,it plugs in, but nothing shows on the monitor. Any suggestions?

    What do you mean by "HD to VGA adapter converter"?
    Do you mean have an HDMI to VGA adapter connected the the Mini's HDMI port?
    Or maybe you plugged n the the included HDMI to DVI adapter and then connected a DVI to DVI adapter?
    In either case that will not work since VGA is analog and the Mini's HDMI port is digital only.
    You need to purchase a mini displayport to VGA adapter. It plugs into the Mini's Thunderbolt port.
    http://store.apple.com/us/product/MB572Z/B/mini-displayport-to-vga-adapter
    Make sure you get a name--brand one. I purchased some el cheapo, no-name ones and they did not work

  • My new refurbished iPhone 4 lights up for no reason every min and stays on for 5 sec?!

    My new refurbished iPhone 4 lights up for no reason every min and stays on for 5 sec! HELP!

    Settings > General > Accesibility > LED Flash for Alerts:   is it on? If so you can turn off the LED flash, but you will still hve to find out what is causing the alert, if indeed it is an alert.

  • W520 long boot time 1 min 30 sec and low Windows Experience Index score 4.6

    Hi
    W520 said is EE (Enhanced Experience 2), booting in 1 min 30 sec !! that's long for me !!
    Is there I can change to make it boot faster or that is normal?
    Also, Isn't the processor Windows assessment score should be greater than 4.6 and
    for the memory greater than 7.2 ??
    Solved!
    Go to Solution.

    4-5 minute boot is sloooowww!!  90 seconds is even slow on a new laptop.  My 4.5 year old Core2Duo at 2GHz with a 7200rpm HD boots Windows 7, including a bunch of programs at startup, in less than a minute.  When I get a W520 I'm expecting it to take less than that.
    W520 i7-2720QM | 32 GB RAM 1333 MHz | FHD 1920x1080 | Quadro 1000M | Windows 7 & Ubuntu 14.04
    Crucial M500 480GB mSATA + 2 x 1 TB Hitachi Travelstar 7200 rpm | BIOS 1.38

  • ITunes wiped all but iTunes purchased music from my iPad mini and my iPod nano instead of transferring the cd uploads into iTunes. Is there any way of recovering my music.  Very disappointed!

    Initially things worked fine. I was very pleased. I had my music library in itunes, on my Ipod nano, and a thumbdrive to back up most of my music.
    When I tried to sync the music from itunes onto my new ipad mini last week it deleted the albums in itunes leaving me with only purchased itunes items in the account, On the new Ipad mini CD's from my collection could not be played but they were in fact listed. My new mac will not read the music files I backed up onto a thumb drive or show the uploaded CD music collection. Additionally when I logged into itunes with out any devices connected from my PC the itunes account was completely up to date with my CD's and purchase items in Itunes. As soon as I tried to sync it with my Ipad mini that virtual access to the collection was wiped out leaving only purchased items.
    By trying to upload CD music from my Ipod nano into Itunes (originally uploaded into itunes from CD's and  synced to the ipod nano in the first place, taking more than a weeks time), I am prompted to reset the entire ipod nano to factory settings (it gives no other option).  I was following the instructions emailed to me from the applecare team. This was my only recourse for recovery of the lost music files, the only device left that had my album collection aside from the owned CD's. Now the ipod nano is being wiped clean and left with only the itunes purchased music ( same thing that happened with the itunes account and now the Ipad). When I disconnect the ipod nano to see if there are any albums still left on the device, it gives me an error that it was improperly disconnected.
    I just wanted to add the music from itunes to my new mac and the new ipad mini. Instead I have lost all of my uploaded CD's and now have only purchased items in itunes, the new ipad mini, the new mac, and the ipod nano.  I have to  re-upload my entire music library into itunes/icloud from CD's again and hopefully be able to then sync it with my new devices.
    However it may be better to buy the itunes purchased music on CD's from a store, Cut my losses while I can and never buy anything from apple or itunes again. Atleast I will not have my entire music collection wiped out for moving it between my own devices. Itunes match doesn't do **** either. I have wasted alot of hard earned cash on devices products and itunes purchases by converting to apple products and services.
    What a big mistake.
    Very dissapointed with the interface. Very Very Dissapointed!
    [email protected]
    [email protected]

    Had the same issue when I changed computers.  I backed up my I-tunes files, including CDs, but I-Tunes will not recognize anything but Apple purchases now.  There were 300+ CDs in that original catalog.

  • Problem with Mac Mini and Panasonic PT-AE700 projector

    I just bought a brand new Mac Mini and intended to connect it through hdmi to my Panasonic PT-AE700 projector (with a 10 m hdmi-hdmi cable and a dvi-hdmi adapter). However there is no signal recognized by the projector.
    Any suggestions? I have tried with two different dvi-hdmi adapters between the Mini and the cable. Both work fine with my MacBook Pro, but with the Mini there is no signal.
    Mac Mini   Mac OS X (10.4.7)  

    Thanks again BSteely for your answer.
    Unfortunately I still haven't been able to get anything out from the projector through HDMI.
    However, I've found someone with a similar problem. It seems the problem is the lenght of the HDMI cable (which in fact is closer to 15 m than 10 m). HDMI is designed to handle at least those 10-15 m runs, but the problem seems to be DVI, which is only capable of something around 5 m. Since I'm converting from DVI to HDMI, I'm subject to DVI's limitations. And the MBP seems to have better capability of handling the weaked signal than the Mini.
    Read more: http://www.avsforum.com/avs-vb/showthread.php?t=712218
    Gefen should have an amplifier (HDMI Super Booster) that could solve the problem. I just ordered it to see if it could help in strenghtening the signal and solve the problem for me.
    Read more: http://www.gefen.com/kvm/product.jsp?prod_id=2939
    If someone has any experience from the booster, please let me know.

  • File sharing between Mac Mini and iMac "breaks" after reboot of either device, and won't restore.  Why?  Running Maverick 10.9.1 on both.  File sharing is setup on both.  Help.

    I'm a new user - recent convert from longtime Windows to Apple.  Thought having desktops and computing aligned with phones and tablets would help.  Not so far.
    I have a MacMini running Mavericks 10.9.1, and an iMac running Mavericks 10.9.1.  File Sharing is set up on both.  If either device is rebooted for any reason, file sharing from the Mac Mini to the iMac "breaks" and will not easily restart.  Various things eventually brings the connection back - usually having to do with checking and unchecking File Sharing, the AFP button, and/or the SMB button on the iMac - but never the same procedure twice in a row.  File Sharing from the iMac to the Mac Mini is never disrupted - always comes back up without a problem.  Screen Sharing also works between both without fail, and comes up after reboot of either.  No problem there.  Only difficulty is from Mac Mini to the iMac. 
    Why?  Any ideas? 

    Should also clarify - usually takes multiple hours of checking/unchecking file sharing settings in order to restore the share between Mac Mini and iMac.  NEVER happens automatically.
    This is disruptive because I've got the Mac Mini pointing to several file locations on the iMac for various things - photos, music, etc. - and they all hang up unless the share is restored.  Real bummer.

  • HT1555 i just got a new apple tv but for some reason the remote only worked for about a min. and than it wount work at all. i tried to pair and unpair but nathing works but when i press a button the light on the apple tv turns off. what should i do?

    i just got a new apple tv but for some reason the remote only worked for about a min. and than it wount work at all. i tried to pair and unpair but nathing works but when i press a button the light on the apple tv turns off. what should i do?

    Have you held the menu and left arrow together for 6 secs ?  (I think you have from what you say).
    Also try unpowering and restarting AppleTV.
    AC

  • Performance Issue using min() and max() in one SQL statement

    I have a simple query that selects min() and max() from one column in a table in one sql statment.
    The table has about 9 Million rows and the selected column has a non unique index. The query takes 10 secs. When i select min() and max() in separate statements, each takes only 10 msecs:
    This statement takes 10 secs:
    select min(date_key) , max(date_key)
    from CAPS_KPIC_BG_Fact_0_A
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    This statement takes 10 msecs:
    select min(date_key)
    from MYTABLE
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    union all
    select max(date_key) from MYTABLE
    Because the first statement is part of an autmatic generated SQL of an application, i can't change it and i have to optimize the data model. How can i speed up the first statement?

    I've ran similar query on a table that has 10 milliion rows, with an index on the date column
    This is what I have found:
    SQL> set timing on
      1  SELECT MIN(ID_DATE) MIN_DATE, MAX(ID_DATE) MAX_DATE
      2      FROM MY_DATE
      3*     WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    SQL> /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 43383
    SQL> SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      2   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      3  UNION ALL
      4  SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      5   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      6  /
    MIN_DATE
    03-APR-76
    06-JAN-02
    real: 20
    SQL> SELECT MIN_DATE, MAX_DATE FROM
      2  (SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      3  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) A,
      4  (SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      5  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) B
      6  /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 10
    SQL> My conculsion, there is nothing you can do to the tables that will improve that particular statement.
    Why can't you modify the application?

  • Min and NVL with subquery

    Hello,
    Below is my query
                     select  nvl( min(csp.coeficient_value),  (select csp1.coeficient_value
                                                                 from csp csp1
                                                                where csp1.rule_code = 'A55' )) coeffient_value
                       from adr,
                            sec,
                            rpr,
                            csp
                      where adr.adr_id = sec.adr_id
                        and sec.account_id = 663799
                        and adr.pcode between rpr.start_pcode and rpr.end_pcode
                        and rpr.rule_code = csp.rule_code
                        and sysdate between csp.start_date and csp.end_date when i run this query it is giving me an error "ORA-00933: SQL command not properly ended"
    Can anyone help me with this?
    As i don't want to hardcode the value of rule 'A55' and want to retrieve from database.
    Thanks for your help.
    Message was edited by:
    AB

    By using below query my problem is resolved.
    select nvl(coeffient_value, (select csp1.coeficient_value
                                                                 from csp csp1
                                                                where csp1.rule_code = 'A55' ))
    from (
    select  min(csp.coeficient_value)  coeffient_value
                       from adr,
                            sec,
                            rpr,
                            csp
                      where adr.adr_id = sec.adr_id
                        and sec.account_id = 663799
                        and adr.pcode between rpr.start_pcode and rpr.end_pcode
                        and rpr.rule_code = csp.rule_code
                        and sysdate between csp.start_date and csp.end_date )Thanks to all for helping me.

  • I have been on hold for 40 mins 16 sec Need tech assistance!

    I have been on hold for 40 mins 16 sec Need tech assistance!

    One Horse wrote:
     …Photoshop CS4 will not install on a new MacPro…
    Did you happen to remove a previously installed trial or regular copy of CS4 or a CS3 installation improperly?
    "Improperly" means by any other means other than using the respective Adobe Uninstallers in Applications/ Utilities/ Adobe/ ….
    For instance, if you dragged anything to the trash.  That would have been improper starting with CS3.  Previous versions could be trashed, but no more.
    If that was the case you need to look for the CS3Clean and CS4Clean scripts on the Adobe site, download them and run them.

Maybe you are looking for

  • Re: Must install Snow Leopard 1st Before Installing Lion

    I am about to purchase Snow Leopard in order to enable Lion download/installation. Before I do, is there any reason to believe this step will be unnecessary within a short period of time?

  • How do I get my hard drive back?

    Hello, I have a duel drive G4 and have just migrated all of my programs and files to my 2nd drive and will use this as the new start up disk. When I finished all my migration and updates I wanted to hide the old drive so it would could be accessed. I

  • FIS2R ... USB Usage ... Anyone here using 5 or more USB devices? ..with stability? Sound off!

    I have 6 currently... WebCam Scanner USB Extension (for DigiCam) Keyboard/Mouse Receiver UPS Communication ...ummm.. thinking... mess of tangled fire hazards in mind.. rummaging.. ehm... ...still thinking.. *counts on fingers* I swear I have all 6 re

  • Sum up years?

    Hi - is it possible to sum up two accounts across 3 years? this is the concept.. new_value = account1 + account2 + Fy09 + fy10 + fy11 thanks

  • Using Aperture with a Network Attached Storage (NAS)

    Hi, I would like to make my Aperture library accessible from severals Macs and for different users on these Macs --- not at the same time. The idea is that only one user from one Mac can use Aperture at a given time. The basic idea is to install the