The questions do not make sense so stop trying to ask them. It’s like asking if 2022-01-01 is an orange.
Generally speaking you want context of what the date or datetime is being used for. If you want to know when Christmas takes place you will use a date: it does not take place on 2022-12-25 00:00:00 through 2022-12-25 11:59:59 because this would require a timezone and Christmas takes place at different UTC times around the globe. But you can reasonably say that Christmas takes place on 2022-12-25 and leave it at that to let the implementation of whatever program figure out if it is or is not currently Christmas based on the information it has about time and timezone.
This is way overstated. It's more like asking if the integer `1L` is between the float `1.0D` and `2.0D`. It requires an implicit cast. Decide whether operations involving LocalDate[0] and LocalDateTime should use the former or the latter as the working type (the latter, IMO), do the cast (LocalDate becomes a LocalDateTime with time component 00:00:00, or LocalDateTime becomes a LocalDate by dropping its time component), then do the operation.
If the types you're dealing with are LocalDate and Instant, then you'd need a contextual timezone to perform the conversion in either direction.
I don't think this is a hard problem, it's just one that requires more specificity than one might think at first glance. Users should be encouraged to read the spec of any language that does these sorts of implicit casts, in the same way that C programmers should be aware of the implicit typecasting rules in that language.
0. I'm using the java.time/org.joda.time type names here. Their equivalents should exist in any good time library. However, I think in reality many libraries fall short of the types you really need to express date & time concepts, which is what leads to so much confusion around them. Once you're familiar with LocalDate, LocalTime, LocalDateTime, OffsetDateTime, ZonedDateTime, Instant, Duration, and Period, (whew), it's possible to be clear about what you're doing.
I think the point is that the nature of software is that these nonsensical questions are “asked” by the code all the time. Data migration, different teams using different formats, user interfaces with imperfect translations, and other scenarios all result in these silly questions popping up. And in the middle sits an engineer who needs to decide how it will work.
And my point is that if you don’t understand what the data field represents, don’t make comparisons against it. You must understand the context and then use the data. Otherwise you’ll ask nonsensical questions and get nonsensical answers and then be surprised.
Actually, in Germany Christmas already starts 12/24, so even this seemingly simplistic example is more complex of you support the entire world. Dates are hard.
Added to that, in some (but not all) Orthodox majority countries, most notably Russia, Christmas is on 25 December by the old Julian calendar, which is on 7 January by the current Gregorian calendar (which everyone uses, Russia included, for civil/commercial/everyday use). It’s Gregorian date moves forward by one day every century (except for every fourth century, when it doesn’t.)
Some of the other Orthodox Churches (such as the Greeks) technically celebrate Christmas, not using the Gregorian calendar, but rather the “Revised Julian” - which happens to be identical to the Gregorian until 2800. I wonder if, come 2800, they’ll remember to move the date of Christmas, or if they’ll think “there’s no point to it, let’s not” (assuming of course that both they, and humanity as a whole, are still around in 2800)
Sure. We can be more specific about which Christmas we talk about. I could have used the USA Independence Day instead (July 4th) as a less universal but still valid example. My point wasn’t about definition of a holiday but about date locality.
Generally speaking you want context of what the date or datetime is being used for. If you want to know when Christmas takes place you will use a date: it does not take place on 2022-12-25 00:00:00 through 2022-12-25 11:59:59 because this would require a timezone and Christmas takes place at different UTC times around the globe. But you can reasonably say that Christmas takes place on 2022-12-25 and leave it at that to let the implementation of whatever program figure out if it is or is not currently Christmas based on the information it has about time and timezone.