4 ms·
I had to fix tests that broke from 11pm-midnight because some assumptions that now() + 1 hour was the same local date.
by cstejerean 5y ago
I had to fix tests that broke from 11pm-midnight because some assumptions that now() + 1 hour was the same local date.
- ihateolives 5y agoI worked with date range in a service that expected start date to be inclusive, but end date to be exclusive. So when you wanted to get data from dates 12-15, you'd have to send query for 12-16.
- tremon 5y agoThat sounds like a naive date->datetime conversion rather than explicit boundary exclusion. If you convert a date to a datetime, you get midnight at the start of day, which is fine if you're only comparing dates, but fails spectacularly in the way you describe for date ranges. MSSQL not supporting a DATE data type has been the bane of my existence for a long time (of course, Postgresql has supported it since forever, but try telling your application vendor that). And since it took so long to include it, hardly any application uses it even today, because of inertia and compatibility with existing databases.