These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Time sheet questions

granteloop
Registered: Feb 5 2009
Posts: 4

I'm new to Designer and have been given the job of create a time sheet. I've have the Date/Time fields down now I need to figure out how to create a field that sums up the difference between my login time field and logout time field as number of of hours worked. Any Help?

Example: Login "8am" logout "4pm" = 8hrs

Grant

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi granteloop,

A series of articles on working with times and dates in both Acrobat and LiveCycle Designer by Thom Parker can be found in the Learning Center. You should give those a read since there is a bit more to it than you might think at first.

Here's the link to Part 1-
http://www.acrobatusers.com/tutorials/2006/date_time_part1

Also do some searches on date calculations in the forums here- how to calculate date and time differences is a frequent topic.

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
www.pdfscripting.com
granteloop
Registered: Feb 5 2009
Posts: 4
Thanks Dimitri

I was able to figure it out by using IsoTime2Num to convert to milliseconds and then dividing by 3600000 to get hrs.

Grant
R_Boyd
Registered: Nov 1 2007
Posts: 151
The link to the third part of Thom's guide is broken!

http://acrobatusers.com/tutorials/2006/date_time_part3
R_Boyd
Registered: Nov 1 2007
Posts: 151
gkaiserill's formula worked very well for calculating the time difference.

I've tweaked it to fit with my flexitime form but have run into a brick wall when it comes to addition.

Whilst I can calculate the duration ((pm end time - am start time) - (pm start time - am end time)) I am having difficulty when it comes to adding up those durations to get the total time worked that week. I suspect it is because the simply adding the times in their current state won't work as it will be more than 1 day.

What time format should I use to get around this problem?
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You will have to convert each days time to a common value like total minutes worked for the day, and then add all the days' minutes and then convert the result to hours and minutes, but you can not use the 'Num2Time' function. You will have to write your own script.

George Kaiser