Report this content
We want the Dreams coMmunity to be a safe, diverse and tolerant place for everyone, no matter their age, gender, race, sexual orientation or otherwise. If you believe this content to contradict these principles, you can file a report for our coMmunity teams to investigate.
Note that misuse of the reporting tool will not be tolerated.Item being reported:
If you've experimented with using the Calculator to do math with the new Date & Time fat wire type, you'll have immediately noticed some counterintuitive results. For example, if you add 00:00:00.000 1/1/1980 to 00:00:00.000 1/1/1990, you get 00:00:00.000 1/1/2000. This is because a Date & Time is represented as a quantity - most likely an unsigned 64 bit integer - of millisecond ticks after the epoch 00:00:00.000 1/1/1970. You can work around this for some cases. But if you try to subtract a later Date & Time from an earlier one, the output fat wire will have a Date & Time that the Splitter can't make head nor tail of.
To fix this, we could have a Signed Time Span fat wire type. Like the Date & Time, it would be a quantity of millisecond ticks, but a signed 64 bit integer instead of unsigned, and not relative to an epoch. The Splitter and Combiner should handle this in a similar manner to the Date & Time, except that no units larger than days should be used. The Signed Time Span could combine with other wire types as inputs to the Calculator to perform the following operations:
- Signed Time Span + Signed Time Span -> Signed Time Span
- Signed Time Span - Signed Time Span -> Signed Time Span
- Signed Time Span * Number -> Signed Time Span
- Signed Time Span / Number -> Signed Time Span
- Signed Time Span / Signed Time Span -> Number
- Signed Time Span % Signed Time Span -> Signed Time Span
- Date & Time + Signed Time Span -> Date & Time
- Date & Time - Signed Time Span -> Date & Time
- Date & Time - Date & Time -> Signed Time Span