Expand my Community achievements bar.

Time In/Time Out/ Total Time Question

Avatar

Former Community Member
I have read MANY posts in regard to changing regular time to Military time. The problem that I seem to be having is that I can't NOT use Military time. I have tried h:MM A format, but it doesn't work. I want the ability to enter in, for example, 8:00 AM for Time In, 12:00 PM for Time Out, and for the form to have 4:00 as the Total Time, but it's not working. Currently, I have the following for the display pattern, edit pattern, validation pattern and data pattern. Many of you are talking about re-writing the information in the XML source area, I don't have the knowledge for that. Any help that you can offer would be greatly appreciated, thanks!

display pattern: HH:MM A

edit pattern: HH:MM

validation pattern : HH:MM A

data pattern: HH:MM A
6 Replies

Avatar

Former Community Member
Firstly doing any kind of adding of time or dates is always trickier than it seems. You will have to use the formcalc functions that will convert a time to a number that represents the number of milliseconds that have elapsed since a set point in time. This function is the Time2Num and Num2Time function. This allows you to calculate the difference in the two times in milliseconds and then convert back to what you want to display.



Now to your original question. I think it is best to understand what those 4 patterns are refering to.



The Display Pattern is the way that the user will see the time on the screen.

The Edit Pattern is the format that you will allow the user to enter into the field.

The Validation Pattern is the format that will be used when validations are done (should be the same as edit pattern)

and finally Data Pattern is the format that will be used when the field is written to a data file or contents of the field is asked for.



This technique allows you the flexability to display to the user a time like 9:24 AM but have military time written to the data file or used when calling the value of the field in a calculation.



If you want to post your email address I will send you a simple sample I put together to show what you are trying to do.

Avatar

Former Community Member
Wow, I don't think I understood half of what you said! My email address is Jpeel@ufgcorp.com.



Thank you explaining the patterns, as I didn't really understand what those were for.

Avatar

Level 1

Hello I was reading your post and was wondering if you still had the information that you sent to Jessica. that is exaclty the formcalc I am looking for  would greatly appreciate it if you could post the formcalc that you emailed to her.

thank you

Avatar

Former Community Member

I don't have it nor do I remember what it was I did. That was at a time when the forum did not allow attachments so we may have taken it offline. If you want to state your case I may be able to pull something together for you.

Paul

Avatar

Former Community Member
Thanks for your help Paul, I couldn't have understood the whole "Time In/Time Out thing without your help. This Forum is in my favorites now so that I can get all of my questions answered!



Jessica