If you're desperate, I tend to move everything to epoch time (in long) since its easiest to do calculations with. The problem with a lot of date sql types is that they ignore set the time of day but not the day of year. The best solution, if possible, is to use the "TIMESTAMP" or "DATETIME" field in the database. Then, whenever you retrieve the record it will have both populated.
Originally posted by Jon Parise: I know java.sql.time is just a wrapper around Date so maybe the Date portions are different.
Not according to the documentation. But maybe there's a timezone issue getting in the way. Anyway, I would go with Scott's suggestion of extracting the getTime() values and comparing those. (Actually just looking at them might tell you something.)
Originally posted by Scott Selikoff: If you're seeing something odd its probably related to time zone. Keep in mind everything is stored in UTC internally, but when its read it may be converted to what it 'thinks' is your local.
Make sure your viewing things in a consistent format such as UTC. That's part of why I prefer the epoch getTime() long value... its a number always calculated in UTC.
What's odd though is in the database it is store specifically without a time zone. Also, the two columns are inserted at the exact same time...