awk can access environment variables using the ENVIRON special array. However, while you can assign values to elements of that array, it is not passed in the environment of the commands executed by awk's system, | getline or print |. That ENVIRON array is only intended for awk to get the value of the environment variables it is passed.
You can do: system("ls " var), but beware that the string that is passed to awk's system() (or print | or | getline) is actually passed as an argument to sh -c, so it is interpreted as shell code.
For instance, if the awk var variable contains foo;rm -rf /, it will not tell ls to list the file called "foo;rm -rf /" but instead to list the file called foo and then the rm command will be run.
So, you may need to escape all the characters special to the shell in that var variable.
This could be done for instance with:
awk '
function escape(s) {
gsub(/'\''/, "&\\\\&&", s)
return "'\''" s "'\''"
}
{
cmd = "date -d " escape($0) " +%s"
cmd | getline seconds
close(cmd)
print seconds
}'
While that means running one shell and one date command per line, you might as well do the reading of the file with the shell itself:
while IFS= read <&3 -r line; do
date -d "$line" +%s
done 3< the-file