Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have a basic solution for calulating the time it takes for a task: task_begin (insert current time) for login and task_end (insert current time) where (task_end) - (task_begin) = total time -- with some calcs for rounding, etc.

Where I need to refine this is when the task-end crosses over midnight and I start getting negative numbers...

I could really use a calc to deal with this eventuality .... thanks in advance:)

Make "task_begin" & "task_end" timestamp fields instead of time fields, then use the following:

GetAsTime ( task_end - task_begin )

Edited by Guest

  • Author

Hey thanks Kent_S; I really appreciate the tip but I don't see an option for a timestamp field in FM 6 -- when I use FM Help, there is no reference to this field type.

What am I missing?

Edited by Guest

Timestamp option is a new feature of the FM7

  • Author

I appreciate the clarity -- thank you.

So ... it seems I can get DayofYear when I simultaneously insert Current time in task_begin and, later, in task_end via a script.

Then if the differential between the two DayofYear values is a whole number I can multiply by 24;

And add in the negative difference between task_begin and in task_end when crossing midnight to get the true duration of time..

Is this the easiet way to accomplish this calculation in FM 6?

Edited by Guest

Yikes, sorry, I hadn't noticed you were using FM6.

Try this:

GetAsTime ( task_endDate - task_beginDate ) * 86400 + task_endTime - task_beginTime

To set this up you'll need to create 2 date fields that get the current date(s) of the task's start and finish dates. You'll also need to format your time field for a 24 hour clock.

Note: I jumped from FM4 to FM7 so I don't have a FM6 to refer to in front of me, but I think everything will work for you in FM6.

Best of luck to you!

  • Author

Thanks once again -- but there is no GetAsTime calc available in FM6

Try this:

(task_endDate - task_startDate) * 86400 + task_endTime - task_beginTime

Make sure calculation result is "Time"

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.