I have a process builder by which I am calculating the time difference between NOW() and another Case object date field.

My formula goes like this

Time_Spent__c = NOW() - Start_Time__c

However when Time_Spent__c is not getting populated correctly. I saw that all time differences are calculated in GMT. What I would like to understand is the difference comes in what value- s(seconds) or mS (milliseconds) >

I needed my value in hours, so I used the below formula

 Time_Spent__c = ((NOW() - Start_Time__c)/(1000*60*60)) - assuming the difference is coming in milliseconds. However the value is still not coming up properly. If (NOW() -Start_Time__c ) equals 5. The time spent is coming as 1.03 which is definitely not correct. Is is a problem of the time zone

Also Start_Time__c was defaulted to NOW() when the case was created.

  • try changing your formula to text and use TEXT(NOW() - Start_Time__c) – rahul gawale Dec 6 at 12:10
  • @rahulgawale , I cannot change it to text. Is there any way of doing it with DateTime field. – user55791 Dec 6 at 15:16

Now() - SpecifiedDateTime returns the difference in miliseconds.

  • I tried it. I needed my value in hours, so I used the below formula Time_Spent__c = ((NOW() - Start_Time__c)/(1000*60*60)) However the value is still not coming up properly. If (NOW() -Start_Time__c ) equals 5. The time spent is coming as 1.03 which is definitely not correct. Is is a problem of the time zone? – user55791 Dec 6 at 12:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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