Hi All
I've calc elemet that calculates the elapsed time from two other elements (starttime and endtime)
The result comes from this code:
The format of the database field is time HH:MM:SS (hour:minutes:seconds) this works OK.
I would like to see only the HH:MM in form and list views, not the seconds.
I've tried to use sprintf on the Format String field in the calc element, but I can't make it work, what would be the correct sprintf format for this?
Best regards
Thomas
I've calc elemet that calculates the elapsed time from two other elements (starttime and endtime)
The result comes from this code:
Code:
return sprintf("%02d:%02d:%02d", $hours, $minutes, $seconds);
The format of the database field is time HH:MM:SS (hour:minutes:seconds) this works OK.
I would like to see only the HH:MM in form and list views, not the seconds.
I've tried to use sprintf on the Format String field in the calc element, but I can't make it work, what would be the correct sprintf format for this?
Best regards
Thomas