You didn't say what icount() is, but if it's the one from contrib/intarray, it's STRICT meaning it'll return NULL, not zero, for a null array input.
(Or IOW, null::int[] is not at all the same thing as array[]::int[].)
> SELECT pTimeToDisplay AT TIME ZONE'UTC' INTO pTimeToDisplay; This is very unlikely to produce anything sane.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных