4 Replies Latest reply on Feb 17, 2013 9:47 PM by Malcolm

# Military Time Calculations

Hi Everyone,

My problem is: I am getting military time added for job start and finish time and I am trying to calculate the on site cost.

What calculation would I use for this provided I have start time, finish time and per hour cost.

• ###### 1. Re: Military Time Calculations

(End time-Start time)*rate?

-- sent from my iPhone4 --

Beverly Voth

--

• ###### 2. Re: Military Time Calculations

The time is in the format of HHMM

• ###### 3. Re: Military Time Calculations

OK I worked it out.

The key was to split the time up into Hours and minutes.

For instance, 0850 to 1000 would be represented as:

8 and 50 and 10 and 00

8 * 60 = 480 +50 = 530

10 * 60 = 600

600 - 530 = 70 minutes

• ###### 4. Re: Military Time Calculations

The key was to split the time up into Hours and minutes.

Exactly right. Now don't get caught doing your own calculations when there are better functions built in. Using the time functions you can handle seconds too and it doesn't matter if they are there or not.

Let (

[

start = "085018";            // this one includes seconds

finish = "1000";           // this one does not

start time = time ( left(start; 2) ; middle(start; 3; 2) ; middle(start; 5; 2) );

finish time = time ( left(finish; 2) ; middle(finish; 3; 2) ; middle(finish; 5; 2) )

];

finish time - start time

)

Malcolm