3 ms·
> Mixed unit durations are in ISO 8601 Don't know why I never noticed it before; thanks for posting this! That does give the idea more weight, so I'll consider
by TeMPOraL 2y ago
> Mixed unit durations are in ISO 8601
Don't know why I never noticed it before; thanks for posting this! That does give the idea more weight, so I'll consider mixed-unit durations next time I find myself coding up parsing durations in config files.
> Should we always normalise? If we do, do we normalise upwards or downwards?
I'd say normalize, but on the business side, down to regular units - e.g. the config or UI can keep its "1m30s" or "90s" or even "0.025h", but for processing, this gets casted to seconds or millis or whatever the base unit is. Now, this is easy when we're only reading, but if we need to e.g. modify or regenerate the config from current state, I'd be leaning towards keeping around the original format as well.
> i do similar handling with dates, and it turns out we often want to preserve the distinction between 1y6m and 18m
Can you share specific examples where does this matter, other than keeping the user input in the format it was supplied even underlying data values get regenerated from scratch?