Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Without more context, they are incomparable. The author only says they came from a UI and a database - but what do they represent? And what UI did they come from (i.e. what information did the user have when choosing the date[time] components, and how were those components encoded into a date[time]?). How are they being used now? I suspect the author is withholding some of these details to make a more interesting conversation (or to describe a "general case", but unfortunately there is no such thing as a general case for date[time]s).


Right. In a general case of a library casting types, the only thing that makes sense is to set the time to 00:00:00.

In practical usage, you would probably want to slice off the times and only compare the dates, or use a fuzzier comparison, or just conclude that your input data is crap.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: