Fixed a bug when calculate the shift_hour.