2 Replies Latest reply on Apr 14, 2016 6:23 AM by chris.machnicki

# Logging time as hours/minutes instead of converting the time into minutes.  Is this possible?

I'd like my call analyst to log time as hours/minutes (hh:mm) so they don't have to convert the time into minutes.  This will save them time and avoid possible error in calculation.

• ###### 1. Re: Logging time as hours/minutes instead of converting the time into minutes.  Is this possible?

Hello Hyle,

I've found a solution to our question. Consider your integer field as "CC_PlannedOutageDuration". Based on this formula, the result of an integer field with a value of 125 will display as "2 hours, 5 minutes". You might want to create another IF statement so that for a single hour it displays "hour" instead of "hours", or you can just change the text to "hour(s)" if you wanted. Let me know if you have any questions. Thanks.

\$(If CC_PlannedOutageDuration > 59 then ToString(RoundDown(CC_PlannedOutageDuration / 60)) + " hours, "+ ToString(RoundDown(CC_PlannedOutageDuration % 60)) + " minutes" else  ToString(CC_PlannedOutageDuration) + " minutes")

1 of 1 people found this helpful
• ###### 2. Re: Logging time as hours/minutes instead of converting the time into minutes.  Is this possible?

If I can add to this.

Using your example I added an expression text label to the form with this expression which accounts for plural/non-plural minutes and hours

\$(if TotalTimeSpent == null then "0"

else if TotalTimeSpent > 59 then

(if ToString(RoundDown(TotalTimeSpent / 60)) == "1" then

ToString(RoundDown(TotalTimeSpent / 60)) + " hour, "

else ToString(RoundDown(TotalTimeSpent / 60)) + " hours, ")

+

(if ToString(RoundDown(TotalTimeSpent % 60)) == "1" then

ToString(RoundDown(TotalTimeSpent % 60)) + " minute"

else ToString(RoundDown(TotalTimeSpent % 60)) + " minutes")

else if ToString(TotalTimeSpent) == 1 then

ToString(TotalTimeSpent) + " minute"

else ToString(TotalTimeSpent) + " minutes")