3 ms·
Ok. So suppose you have feeds of data that lead into your database. These come from various sources and some of the feeds go through different pathways in pro
by einhverfr 13y ago
Ok. So suppose you have feeds of data that lead into your database. These come from various sources and some of the feeds go through different pathways in processing before being entered. Let's say that for some hypothetical legitimate reason some feeds are truncated to the date. These all get stored as timestamps in your database.
Now many db's (maybe even most) will happily cast dates to timestamps, but they do this by filling in 00:00:00 for the time. If you have to special case these in your front end, being able to treat truncated datetimes as having no date could be quite helpful.
Now this would not be an ideal design, I think we'd all agree. It would be very remotely possible a date could be 00:00:00.000000 in time and so you'd have some false positives. Ideally we'd put a flag on the record to say the date had been truncated, but you know, there are always cases where legacy code gets in the way of sane fixes.
In an ideal world this might never be a useful feature. In the real world I could imagine a number of uses in working around systems which one cannot reasonably safely or easily modify.
Yes, you could special case check for midnight. But there are cases where "midnight is false" happens to correspond to actual behavior elsewhere.