title

fire chief's random developer tidbits

Thursday, July 12, 2012

When a Date is not a Date

Just because something like Oracle SQL Developer shows a date column and does not show the time, don't assume that's the type of the column.  For whatever stupid reason it defaults the format of a Date column to not include the time, even though by default an Oracle Date type has a time included.  This bad assumption on my part and bad default on their part led to an hour or so of wondering how a query in existing code could possibly work because I kept using a date with no time as my test data.  Yes it can work as long as the hh:mm:ss is included in the query.  Grr.

Anyway, here's how to configure it for the next time I need it:
Tools -> Preferences -> Database -> NLS
Change Date format to: DD-MON-RR HH:MI:SS