Hi.
I struggled with this one a bit so when I found the answer I thought I would post it. -mostly so that when I forget I'll find it here to remind myself!
The duration data type formats very nicely into words -
MyDuration := (23.4 * 60000);
MESSAGE(FORMAT(MyDuration));
gives a very nice "23 minutes 24 seconds". However, if you want to change the format there are no formatting functions for a duration. The only way to show this as 00:23:24 is to convert it into a DateTime variable and format that
MyDateTime := CREATEDATETIME(TODAY,0T);
MyDateTime += MyDuration;
MESSAGE(FORMAT(MyDateTime,0,'<Hours24,2>:<Minutes,2>:<Seconds,2>'));
I hope this helps.
Comments