7 Replies Latest reply on Jul 23, 2013 4:23 AM by tflannery

# Set time field in 15 minute increments

Newbie here. With that said...

I am creating a time sheet for the iPad with TimeIn and TimeOut fields. They are set as Time type. Is there a way to set the minutes to show 15 minute increments on the dial instead of showing all 60 minutes?

• ###### 1. Re: Set time field in 15 minute increments

Hello, tflannery.

You can't directly set a Time field to display in 15 minute increments. You could, however, create a calculation field that would do so and display that instead. For example:

Let ( [

timeField = {your time field here} ;

timeInHrs = timeField / 3600 ;

hr = Int ( timeInHrs ) ;

minSec = timeInHrs - hr ;

mn = Int ( minSec * 60 ) ;

qtrHr = Ceiling ( mn / 15 ) ] ;

qtrHr

)

This calculation will give you a 1 if the time is in the first quarter hour, a 2 if in the second, and so forth. If you want to have an actual time, then you might do something like this:

Let ( [

timeField ={your time field here} ;

timeInHrs = timeField / 3600 ;

hr = Int ( timeInHrs ) ;

minSec = timeInHrs - hr ;

mn = Int ( minSec * 60 ) ;

qtrHr = Ceiling ( mn / 15 ) ] ;

GetAsTime ( hr & ":" & qtrHr * 15 & ":00" )

)

HTH

Mike

• ###### 2. Re: Set time field in 15 minute increments

Thank you Mike.  I will try that and let you know.  So, if the user is adding a new record and enters one of the time fields with this calc, the minutes will show in 15 min increments?

• ###### 3. Re: Set time field in 15 minute increments

No. You'll have to set up an entry field where the user puts the actual time in, then show this field separately. You can do that through a scripted process with a dialog.

Mike

1 of 1 people found this helpful
• ###### 4. Re: Set time field in 15 minute increments

Not what I wanted to hear.    But, thank you for your help. I'm going to play with this over the weekend.

• ###### 5. Re: Set time field in 15 minute increments

Of course, you could set this up as an auto-enter calculation on the field such that it replaces the input. But that overwrites the data the user puts in, which may not be what you want.

Mike

• ###### 6. Re: Set time field in 15 minute increments

You can use separate number fields for the hours and minutes.

On the minute field attach a pop-up menu using a value list should the increments you want.

The actual time field will be a calculation combining the hour and the minute number fields.

• ###### 7. Re: Set time field in 15 minute increments

Thanks David.  That is what I ended up doing.  Works like a charm.