Problem with time

Neither will run as you present it. Adding a closing quote and a file, I tried this on SunOS:
awk 'BEGIN {print mkzzzime("2005 07 01 34 30")}' < /dev/null
and I got:
2005 07 01 34 30

There is no such thing as mkzzzime in awk, but there is no mktime either. awk on SunOS is ignoring a bogus function. On HP-UX, I get:
awk: Function mktime is not defined.
The source line number is 1.

Your sh knows about a variable called TIME, but your awk does not. Even if it did, that's not how you use a variable in awk. You might try something like:
p=987
awk -v p=$p 'BEGIN {print p}' < /dev/null

See the faq section, specificly,
Passing variables/arguments/parameters to commands.