I am calculating formula to get difference between to date/time fields. But in minutes section it always shows 1 minute less or sometimes 1 min extra.

Example if Start Time- 08.06.2018 09:28 End Time- 08.06.2018 10:38 then difference coming as 0 Days 1 Hours 9 Mins Whereas it should be 10 Min.

I am simply lost from many days. This works fine with my developer org but not in the sandbox. Can anyone please help?

Formula :

TEXT(ROUND(MOD((ClosedTimestamp__c - OpenedTimestamp__c)*1440,60),0))

Output in UI

In DE org: enter image description here


DateTime datatype stores the data upto mili seconds.

From the datetime, you are displaying the Open Time and closed time at minute level and omitting the seconds.

Because of that you are getting erratic results.

To get more precise results calculate elapsed time up to seconds.

By the way, this calculation results should be same in DE or sandboxes.

You can refer similar calculation here, Case duration of ageing

Update based on comments

To get the calculation perfectly at minute level, separately store the data up to minute level the way Date1 and Date2 are showing and then formula should calculate the difference from those fields.

  • Thanks Santanu! Yes this is what I thought first but in DE org it always come correct but in sandbox it is always 1 min less or more. Added one more snap from DE org. Is there anyway to make it accurate? – shukla yogesh Jun 10 '18 at 19:13
  • Is that my answer serves your purpose? – Santanu Boral Jun 13 '18 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.