COLLECTION TO ARRAY for Time fields?

17r6

When I try this:
ARRAY TIME($MyTimeArray;0)
COLLECTION TO ARRAY($MyEntSel;$MyTimeArray;“MyTimeFieldName”)

My time array is not populated correctly: it’s populated only with 00:00:00.

If I look at the entity selection in the debug window: it shows times as numbers (seconds since midnight).

IS THIS A BUG that 4D won’t populate a time array from a time field in COLLECTION TO ARRAY?

Same in R5 client/server (I assume you have a line that converts your entity selection to a collection). But - a longint array works instead of a time array.

Hey Jeff,

I assume you have a line that converts your entity selection to a collection

Yes: thanks for pointing that you.

I’m doing a toCollection on an entity selection, and then a subsequent COLLECTION TO ARRAY.

But, for time arrays, I end up needing specify a Longint array, and then loop through, copying the longint array to a Time array.

So: not sure if the “fix” for 4D would be in the toCollection, or the COLLECTION TO ARRAY, or both.

It looks like they are displayed as longints and not times all the way back in the entity selection itself… and it stays represented as longints through the toCollection and COLLECTION TO ARRAY.