function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
WoosterWooster 

Page Layout Change Field Display

I have a formula field of type Number that is displayed in seconds.  I want to be able to format the display of this field to something like HH:MM:SS so the original value of 8196 would show as 2:16:36  I've thought about using another formula field of type Text and doing the display conversion there but would rather not have to create a new field just to get a nicely formatted display on the page.
Best Answer chosen by Wooster
VinayVinay (Salesforce Developers) 
Hi,

I don't think this is possible,  Below is the Idea link for the same.

https://trailblazer.salesforce.com/ideaView?id=087300000006nml

As workaround, you can use time field.

https://trailblazers.salesforce.com/answers?id=9063A0000019gJAQAY
https://help.salesforce.com/articleView?id=custom_field_time_overview.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi,

I don't think this is possible,  Below is the Idea link for the same.

https://trailblazer.salesforce.com/ideaView?id=087300000006nml

As workaround, you can use time field.

https://trailblazers.salesforce.com/answers?id=9063A0000019gJAQAY
https://help.salesforce.com/articleView?id=custom_field_time_overview.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
This was selected as the best answer
WoosterWooster
Vinay,

I tried changing the value to a Time field but getting syntax errors.  My formula field needs to be as follows with 2 date time fields:

CloseTime__c - EndTime

This returns the number of seconds between the 2 date time fields.  I then want this converted to a readable format of HH:MM:SS

Any suggestions?
WoosterWooster
This is what I came up with, works for me:

IF(LEN(TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24), 24))) = 1, '0' + TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24), 24)), TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24), 24))) + ':' + IF(LEN(TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60), 60))) = 1, '0' + TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60), 60)), TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60), 60))) + ':' + IF(LEN(TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60*60), 60))) = 1, '0' + TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60*60), 60)), TEXT(MOD(FLOOR((Close_Time__c - EndTime)*24*60*60), 60)))