How to input elapsed time

I am setting up a database in AppleWorks and am trying to input elapsed time rather than time of day so 1:15:20 is 1 hour, 15 minutes, 20 seconds not a time of day. I'd then like to use this field to calculate an average speed among other things. Is an elapsed time possible in apple works or just a time of day?
Thanks,
Chris
Powerbook G4   Mac OS X (10.4.7)  

Hello
Databases allow you to define a field as a Time.
It works in the range 0 thru 23h 59m 59s.
1 hour is represented by the number 1/24 .
You may define the format used by time fields using the Format > Number menu and yes, ou may make arithmetics with time values.
CAUTION the results may seems to be odd when calculations give a negative result as, I already write about that, time's values are in the range 0 thru 23h59m59s.
Yvan KOENIG (from FRANCE dimanche 27 août 2006 19:11:16)

Similar Messages

  • How to calculate elapsed time based on user input

    I'm not sure what to do next in this program. Basically, I'm not sure exactly how to get the time to output accurately, as in what forumla I should be using.
    This is the question:
    What comes 13 hours after 4 o'clock? Create an ElaspedTimeCalculator application that prompts the user for a starting hour, whether it is am or pm, and the number of elapsed hours. The application then displays the time after that many hours have passed. Application output should look similar to:
    Enter the starting hour: 7
    Enter am or pm: pm
    Enter the number of elapsed hours: 10
    The time is: 5:00 amHere's the code I have so far:
    import java.util.Scanner;
    public class ElapsedTimeCalculator
         public static void main(String[] args)
              int starting_hour;
              int starting_minutes; /*This is added in case the user wants to add minutes as well.*/
              String am_or_pm;
              int elapsed_hours;
              int elasped_minutes;
              int time_hours;
              int time_minutes;
              System.out.println("Welcome. This application will give you the time based on your input.");
              System.out.println(" ");
              Scanner input = new Scanner(System.in);
              System.out.print("Enter the starting hour: ");
              starting_hour = input.nextDouble();
              System.out.print("Enter the starting minutes: ");
              starting_minutes = input.nextDouble();
              System.out.print("Enter either 'am' or pm': ");
              am_or_pm = input.nextString();
              System.out.print("Enter the number of elapsed hours: ");
              elapsed_hours = input.nextDouble();
              input.close();
              time_hours =
              time_minutes = 
              if(am_or_pm = "am" || am_or_pm = "a.m." || am_or_pm = "AM" || am_or_pm = "A.M.")
                   System.out.println("The time is " + time_hours + ":" + time_minutes + "am");
              if(am_or_pm = "pm" || am_or_pm = "p.m." || am_or_pm = "PM" || am_or_pm = "P.M.")
                   System.out.println("The time is " + time_hours + ":" + time_minutes + "pm");
    }To calculate time_hours should I just calculate this by adding the elapsed hour to the starting hour? I doubt it will be accurate for all situations.
    Same for the time_minutes For example, if the starting minutes and the elapsed minutes were 50, it would be greater than 60. Also, not sure if it makes sense to separate hours and minutes like this, it's not required to in the question. I initally thought it would be easier to approach like this instead of allowing the user to input a double for the starting hour. ex. 5.7
    I get the feeling that this is extremely simple, but nonetheless, I'm stuck, so any help would be appreciated.

    Well thanks to both of you. I did a little reading up on the modulus operator and coupled it with some logic (although, truthfully, I'm not really using to there actually being an application for the remainder of a division operation, since it's never really used very much in any of my Math courses) and the hours portion works perfectly now:
    import java.util.Scanner;
    public class ElapsedTimeCalculator
         public static void main(String[] args)
              int starting_hour;
              //int starting_minutes; /*This is added in case the user wants to add minutes as well.*/
              String am_or_pm;
              int elapsed_hours;
              //int elasped_minutes;
              System.out.println("Welcome. This application will give you the time based on your input.");
              System.out.println(" ");
              Scanner input = new Scanner(System.in);
              System.out.print("Enter the starting hour: ");
              starting_hour = input.nextInt();
              //System.out.print("Enter the starting minutes: ");
              //starting_minutes = input.nextInt();
              System.out.print("Enter either 'am' or pm': ");
              am_or_pm = input.next();
              System.out.print("Enter the number of elapsed hours: ");
              elapsed_hours = input.nextInt();
              input.close();
              int time_hours = 0;
              //int time_minutes;
              String meridien;
              if(am_or_pm.equals("am"))
                   time_hours = (starting_hour + elapsed_hours) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("am"))
                   time_hours = (starting_hour + elapsed_hours) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("AM"))
                   time_hours = (starting_hour + elapsed_hours) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("A.M."))
                   time_hours = (starting_hour + elapsed_hours) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("pm"))
                   time_hours = (starting_hour + elapsed_hours + 12) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("p.m."))
                   time_hours = (starting_hour + elapsed_hours + 12) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("PM"))
                   time_hours = (starting_hour + elapsed_hours + 12) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              else if(am_or_pm.equals("P.M."))
                   time_hours = (starting_hour + elapsed_hours + 12) % 24;
                   //time_minutes = (starting_minutes + elapsed_minutes) % 60;
              if(time_hours < 12)
                   meridien = "A.M.";
                   System.out.println("The time is: " + time_hours + ":00 " + meridien);
              else if(time_hours > 12)
                   meridien = "P.M.";
                   System.out.println("The time is: " + time_hours + ":00 " + meridien);
    }Now the only thing is the minutes. My teacher did say she wants the user to have the option to input minutes also if he/she desires, so I do need it. However, the only problem is that if say the user inputs a "starting minute" of 14 for example, and 66 minutes elapsing, then (14 + 66) int/ 60 = 1r20 but using the modulus operator would only give me 20. So how will I be able to add any extra hours if it is necessary?

  • How to display elapsed time on TPC-2006 (Pocket PC 2003) as mm:ss?

    The small attached PDA vi is a simple "egg timer" that measures elapsed time in minutes and seconds.  I've tried every formatting trick I can think of, but cannot get my TPC-2006 to display the elapsed time as mm:ss.  It always displays single digit minutes and seconds using one digit instead of 2.  By this I mean that an elapsed time of 1 minute and 6 seconds will display as 1:6.  My customer expects that elapsed time to display as 01:06.
    I tried attaching a %t constant to the "format string" input of the "format into string" sub-vi, but the deployed display showed %t instead of elapsed time.
    The second question is, how do I get rid of the up/down icons in the strip display box?  They do not show in the virtual front panel, but always show up in the deployed application.
    Jeff
    Climbing the Labview learning curve!
    Sanarus Medical
    Pleasanton, CA
    Attachments:
    MinSecTimer.vi ‏12 KB

    Hi Jeff,
    I solved your first problem. The format string you were looking for to wire into the Format Into String function is %02.0f. Honestly, I can never remember what the syntax is for format strings, but I've devised a method anyone can use to make it really easy. First of all, place a numeric constant on the block diagram. Right click the constant and select Format and Precision. From that dialog, make the changes you like. You can actually see the changes propogate to the constant in real-time if you can see the block diagram constant. In your case, the change you wanted to make was Zero Padding - 2 spaces - pad with zeros on the left. After you've configured your number to look like you want, click on the Advanced Editing Mode radio button at the bottom. This is where you can manually enter in Format Strings for numeric constants or controls. The trick is, whatever changes you currently have made in the default editing mode will show up as a format string that you can copy and paste and use as you like. Hope this helps!
    Message Edited by Jarrod S. on 05-25-2006 11:02 AM
    Jarrod S.
    National Instruments
    Attachments:
    double_digit_MinSecTimer-2.vi ‏12 KB
    Default_edit.JPG ‏41 KB
    Advanced_edit.JPG ‏43 KB

  • How to get elapsed time of the query in form 6i

    hi
    I used to use " set timing on " in sql to get the elapsed time
    set timing on
    elapsed time :XX:XX:XX ,
    but i dont know how to get it in fom
    its really imporant to measure the time elapsed for me cuz i am student an need to get the time
    thanx alot

    regarding to point 1 : u know there are three modes for system ; query, enter_qeury,and normal. when the system is not noraml so it is either query or enter_query , and both are query processing ( as i think) so it the elapsed time . it also by using timer stpos when system finish query ( normal)
    why you dont prefer timers ..... ( it important please to explain )
    thank you very much Navnit Punj
    Edited by: user8652693 on 22/07/2009 07:33 ص

  • How to calculate elapsed time(including time and date)?

    Hi all,
    I want to realize a function that can calculate the elapsed time which include time and date.Below is my thought:get the current time and date and store it to a .txt file then using the latest time and date subtract the time and date stored in the .txt file.how can realize it using the simplest way?I'm using LV7.1.

    Hi Idragon,
    you can do it like this.
    Mike
    Attachments:
    DateTime.PNG ‏12 KB

  • How to get elapsed time in case struture?

    I'm trying to get Elapsed Time VI to work but couldn't figure out how to use it properly.
    I have a subVI with state machine structure to decode data stream from serial port.
    State1 uses VISA read to read a byte and check if it is the Start of Frame. If TRUE, goes to State2. If FALSE, loop back to State1 and try again.
    If the State1 keeps getting FALSE for certain time (e.g. 5 seconds), stop the subVI and insert custom error code.
    So I have to calculate the elapsed time since State1 starts to be FALSE and keeps to be FALSE.
    I tried to use Elapsed Time VI but have problem of understanding it well.
    Is there any other better solution than using Elapsed Time VI? Also, how long is the execution time of Elapsed Time VI?
    Any suggestion will be very much appreciated.

    Hi,
    The Boolean output (Time Elapsed) in Elapse Time VI should give True when time got elapsed.
    Else we can simulate using "Tick Count (ms)", which counts the ticks in milisecond. You can move on to state 2 when count reaches to reauired duration.
    We can give you better idea if you post the code VI.
    Regards
    Haneef

  • How to get elapsed time from start of current day

    Hello,
    I've tried to use the DateDiff function to calculate the elapsed time, starting from 00:00:00:000 (Midnight of current day), but I'm getting hung up on how to inform the function of what date values it should use.  I could parse off the time section
    of the
    GetDate() function, but that doesn't seems a little klunky to me. 
    So, what I'm trying to capture is this (pseudo code): 
    Elapsed Time (int) =    Select DateDiff(seconds, Current Day.Midnight, CurrentDay.CurrentSecond)
    Any help is greatly appreciated.
    Cap

    Hello,
    So something like this? You can change it around, I used variables so you can see and check (and play with) the values.
    DECLARE @CurDay DATE = GETDATE()
    Declare @SecondsToDate INT
    SELECT @SecondsToDate = DATEDIFF(SECOND, @CurDay, GETDATE())
    SELECT @SecondsToDate AS SecondsPastMidnight
    -- do the check
    SELECT DATEADD(SECOND, @SecondsToDate, CAST(@CurDay AS DATETIME))
    Sean Gallardy | Blog | Microsoft Certified Master

  • How to use elapsed time function with state machine in Lab VIEW

    Hello
    I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
    Could you please have a look to my code and help me to solve this issue.
    Regards 
    Rajab
    Solved!
    Go to Solution.
    Attachments:
    daq assistance thermocouple(sate machine raj).vi ‏436 KB

    Rajab84 wrote:
    Thanks apok for your help
    even with pressing start it keeps running on wait case 
    could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
    Best Regards 
    Rajab 
    OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
    run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
    "start"= false, stay in current state. If true, transition to "1 min" case
    reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
    reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
    Once cycle count reaches 2, stop while loop.... 
    Attachments:
    Untitled%202[1].vi ‏42 KB

  • How to tell elapsed time

    Can someone tell me the best way to tell elapsed time in seconds.
    would it be option a or b? 
    in option b I do not understand output elapsed time? Can someone
    explain it too me please 
    can someone tell me the best way to tell elapsed time in seconds.would it be option a or b? 
    In option b I do not understand output elapsed time? Can someone explain it too me please 
    Solved!
    Go to Solution.
    Attachments:
    elapsed time.JPG ‏97 KB

    Nobody mentioned what "long" and "short" means here.
    The tick count is a U32 and is thus good for about 49 days before it rolls over. Any time difference below ~49 days will be accurate.
    Taking a tick count is very efficient. It is best to display the result as milliseconds, no division needed. I love integers!
    Resolution is milliseconds, which is sufficient on Windows (shorter times are probably meaningless). Still there is also a version available that has much better resolution. Substitute if desired.
    The time stamp carries more baggage (more complex datatype) and is directly in seconds. It is probably overkill for benchmarking.
    Considering  average system up-times (monthly reboots due to system updates, etc). The plain tick count is sufficient for virtually any timing task you need.
    LabVIEW Champion . Do more with less code and in less time .

  • How to get elapsed time?

    I am writting in c++ and i want to know how much time has elapsed while executing some part of code. In windows I would use GetTickCount() like this:
    time=GetTickCount();
    //some code
    time=GetTickCount()-time;
    printf("Time elapsed: %d",time);
    What function can I use in linux? The function doesn't have to be portable but it must have at least millisecond resolution.

    thx! even better than I needed .

  • How to stop the "Elapsed Time" counting without stop the program running?

    我使用Labview 8.2,配合USB DAQ來做測試治具。目的:
    當檢測到某個電壓(Analog Input)到達某個電壓值(5V)之後,開始啟動計時。若是在15秒之內,另一個電壓值降為0之後為正常​,此時停止計時(但是數值不能歸零);若是超過15秒還沒有降到0伏,則表示錯誤,此時亮起紅色 indicator警示,但是時間仍然繼續計時,直到電壓降到0為止才停(但是數值不能歸零)。
    我使用 Elapsed Time 模組來使用,可是問題是如何讓該模組停止計時同時不能將時間歸零?因為此模組只有 "Reset" 控制功能,一但將條件結果輸入到 Reset input 之後,電壓達到零之後就會將此 Elapsed Time 歸零了。有沒有解決辦法?

    Elapsed Time 確實會將時間reset,如果你想要保留時間的話其實有很多做法
    例如使用 tick count,他會顯示出相對時間數值,先放一個tick count在迴圈開始前
    記得用sequence以確保他會在回區尚未開始運作前先記錄時間
    然後再放一個tick count在迴圈內,再用case或select讓電壓等於零時記錄下tick count的值
    再將兩者相減即可
    Chris

  • How can I display the elapsed time of the course using Advanced Actions in Captivate?

    I have a Captivate course which is approximately 35 minutes in length. On each slide I would like to display to the user, the current elapsed time.
    EXAMPLE:
    25/35 minutes complete
    The 35 would remain static, so I have been working with the elapsed time system variable in CP: elapsed:$$cpInfoElapsedTimeMS$$
    I can't seem to get the variable to properly display the elapsed time in minutes, rather than miliseconds. Attached is a screen shot of my advanced action.
    Can anyone provide guidence regarding how I should structure this differntly?

    I talked about that Timer widget in that blog post and pointed to another one:
    http://blog.lilybiri.com/timer-widget-to-stress-your-learners
    If you are on CP7, you'll have this widget also as an interaction, which means it is compatible with HTML5 output. Amd there is also an hourglass interaction, with similar functionality but... did not blog about that one
    PS: Check Gallery\Widgets to find all widgets. Default path is set to Interactions

  • How can I get the elapse time for execution of a Query for a session

    Hi ,
    How can I get the elapse time for execution of a Query for a session?
    Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
    Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
    Thanks in advance.

    Hi
    You can use the dbms_utility.get_time tool (gives binary_integer type value).
    1/ Initialize you time and date of beginning :
    v_beginTime := dbms_utility.get_time ;
    2/ Run you procedure...
    3/ Get end-time with :
    v_endTime := dbms_utility.get_time ;
    4/ Thus, calculate elapsed time by difference :
    v_elapsTime := v_endTime - v_beginTime ;
    This will give you time elapsed in of 100th of seconds...
    Then you can format you result to give correct print time.
    Hope it will help you.
    AL

  • HOW TO INPUT TAX CODE AT MULTIPLE PO ITEM LEVEL AT A TIME

    If a PO  is having 100 line of items, how to input the tax code for all line items at a time, if tax code for all line of times is same.

    Hi
    Another option is to use the t-code MASS. I havenu2019t used in PO but I think it must run.
    Select BUS2012 in u201CObject Typeu201D field. Press F8.
    Select u201CPurchase Order Itemu201D in u201CTablesu201D tab, and click on the u201CFieldsu201D tab.
    Select the field name MASSEKPO-MWSKZ. Press F8.
    Assign the value to the PO field.
    In the menu, select u201CMass maintenanceu201D->u201DEnter new field valuesu201D.
    Assign the new value and press u201CTranferu201D button.
    Press F8. Click on the u201CCarry out a Mass Changeu201D button and click on the u201CSaveu201D button (Ctrl+S)
    Review the u201CMessages from the Update Tasku201D.
    Best regards.
    Paco M

  • How to get Sum for my Elapse Time string for my group

    Hi,
    How can I get the sum of an elapse time string in my group footer 2 and group footer 1 from the report screenshot attached.
    I have a report that display TimeIn and TimeOut of an employee.
    For the total time I have created a formula that will take my time in seconds and displaying it in hrs, minutes and seconds.
    How can I get the sum of all the total time per day and display this in my group footer 2.
    As well I will need to add the grand total to group footer 1 for the total of days.
    The formula I have for the total time is as follow:
    WhileReadingRecords;
    NumberVar TotalSec :=  {TimeLogs.TotalTime};
    NumberVar Hours   := Truncate  (Remainder ( TotalSec , 86400) / 3600) ;
    NumberVar Minutes := Truncate  (Remainder ( TotalSec , 3600) / 60) ;
    NumberVar Seconds := Remainder (TotalSec , 60) ;
    Totext ( Hours ,   '00' ) +  ':' +
    Totext ( Minutes , '00' ) +  ':' +
    Totext ( Seconds , '00' )
    This is a seperate question below but related as well to this report.
    Another question I have is how can I round up for example 03:30:58 to 03:31:00
    And also how can I round down for example 03:26:10 to 03:26:00
    Any help would be appreciated.
    Thank you,
    Joe

    Hi Jamie,
    Well I ran into an issue with this. My Daily Total, there is no issue, it is displaying the proper time. But when I add a summary to my Group Footer 1, it doesn't add up properly.
    If I select only 1, 2, or 3 days my Date Range Total is adding fine but when selecting 5 days for example, as you can see from the picture below, for an unknowned reason the total of hrs is wrong.
    Do you know why this is happening.
    Than you for your help.
    Joe
    Picture below, this is working fine?

Maybe you are looking for

  • Time to upgrade video card?????

    I have a two year old MacPro 2.66 GHz Dual-Core Intel with 4 GB RAM, 4 internal 7200 rpm 500gb HDs and a NVIDIA GeForce 7300 GT (256mb) video card. Would upgrading the video card improve the operation of LR2 relative to the rest of my hardware and if

  • How do I convert an AppleWorks document to a PDF file?

    How do I save the document as a PDF file? Whether it's the entire or a selected part of it. I did it a while ago and forgot. Yes, I have tried the Appleworks help but didn't find it. It's gotta be simple. G5 2.3 dual   Mac OS X (10.4.6)  

  • Since an ios upgrade on my ipod, my device no longer appears in itunes or my computer

    Since a recent ios upgrade, I can not locate my Ipod touch 5th generation in iTunes nor in My Computer. I am working with Windows 7. I have uninstalled and reinstalled itunes, quicktime and Apple Mobile Device Support software programs. I have also g

  • BT you are a joke

    Having done some checking for BT infinity coming to carlisle in june,now they are saying only very small parts of the city centre are going to be able to get fibre,BT pathetic excuse is its not viable to do other parts of the city,what good is the ci

  • EAN/UPC CODE and PURCHASING GRID

    Hi Experts, In material master can you please let me know how to configure, 1)    EAN/UPC Code configuration in Material Master 2)    Purchasing grid I need the info urgently. Regards, Subha