Tinderbox Forum

Format Interval

Is it possible to format interval so that when it is greater than 24 hours the results say hours and nat “X days y hours”? I want it to say (“36 hours 19 min) and not (1 Days 12:19:15”)?

Format where/how? In Get Info or Displayed Attributes - no, it’s not possible. In other case context, e.g. export it likely is. But, as already reported to @eastgate I don’t think Interval.format("formatString") works (i.e not at present!), fixing that might solve your problem.

For now, using operators like Interval.day and a bit of simple maths with get you the desired result, albeit not in Get Info or Displayed Attributes.

Gotcha…ya, interval.format(“formatstring”) does not appear to do anything right now. You’re right.

Yes, I’ve flagged that elsewhere. I think it is an oversight of incremental gorwth. IIRC, .format() and certainly format() pre-date the Interval data-type, thus the unimplemented functionality.

1 Like