Why would you ever need this bizarre piece of date(time) metadata ((un)certainty) encoded into your date(time) string?
Why would you ever need this bizarre piece of date(time) metadata ((un)certainty) encoded into your date(time) string?
# This is true
Date("192X-XX-XX") >= Date("1920-01-01")
# This is false
Date("192X-XX-XX") < Date("1920-01-01")
# This is unknown
Date("192X-XX-XX") == Date("1920-01-01")
I don't like splitting dates across multiple fields and writing custom logic. It'd be nicer to have a standard and (eventually) a good library to lean on. d < I means date d is before any date in I
d > I means date d is after any date in I
d == I means date d is included in I
This would make your last equation 'true'.If instead you rather prefer to leave 'd == I' undefined, I could hardly find it convincing that you assign a truth value to '<='.
>'Date("192X-XX-XX")' denotes the interval [Date("1920-01-01") ... Date("1929-12-31")]
The partial date is not the set, but a single date that is in a set. There is notation for sets of dates:
# Each means a single day in the 1920s
192X-XX-XX
[1920-01-01..1929-12-31]
# A collection of all days in the 1920s
{1920-01-01..1929-12-31}This level of uncertainty would, I think, have too much flexibility for lots of normal business code. There is always an inherent tradeoff when writing code for use cases capturing real-world events between perfect fidelity of your model and coding ergonomics. Things about the real world are not known with perfect certainty, but if you can't capture them with discrete types (for example, CAR_STARTED vs. [Probability of CAR_STARTED = 99.9%, Probability of START_SENSOR_MALFUNCTION = 0.1%]), your downstream logic will be a huge mess. It can be cheaper to handle rare issues caused by lack of fidelity with business processes. Our time notion does not have as many degrees of freedom as this standard.
Throw in different calendar systems and you can have a mess. It's one of the things that people think is simple, but really isn't.