If timestamp comes in following format, Sat Sep 17 2016 20:00:00 GMT-0500 (Central Daylight Time), it is impossible to get 20 or 8 PM as the hour. The database adds GMT (500 ) and then gives 1 in the morning. There are only 12 hours available and when 13th hour is reached, it adds one to the date.
1 <- Hour
25 <- Day extracted from the date
Thu Jul 24 2014 20:00:00 GMT-0500 (Central Daylight Time) <- trunc hour from the date
Thu Jul 24 2014 20:30:00 GMT-0500 (Central Daylight Time) <- Real date from the data
I lost a whole deal of work after discovering this blatant hole in the software. Very immature.