Fixed time zone bug in query