createODBCDate() Returns 'Time' as Well?
I was using the createODBCDate() function because I only wanted the ‘date’ part of a date object, not the ‘time’. More than likely I should have been using dateFormat(), but that’s another story :)
I had the following:
The problem was I kept getting -1 returned, meaning that ‘q.DateTimeCreated’ was less than ‘now()’. As ‘q.DateTimeCreated’ was technically created before ‘now()’ (same day but an earlier ‘time’) it is actually less than, but I only wanted to compare the date…not the time. When I dumped both date objects I got:
Looks the same to me…
I think that those date objects actually have the ‘time’ in them as well, they’re just not being displayed on cfdump or cfoutput. This seems strange especially considering there is a createODBCDateTime() function as well.
My fix was to do what I probably should have done in the first place; use dateFormat()
That did the trick!
Now the only thing bothering me is whether the createODBCDate() function actually does return the ‘time’ as well…or was something else the culprit?