> I would need to write a mapping table for the TZ values
Yes. Or this may help you:
GNU date(1) happens to be quite good at flexible date parsing. (This is
non-POSIX, and BSD systems vary wildly in their date(1) offers in this
respect.) GNU date(1) understands timezones names, and warns about the
"EST vs. EST" problem in its man page.
So, with your data and "in awk":
awk '
{
# system(sprintf(....)) or if you need the date as variable:
sprintf( "date -u +%%s -d \"%04d-%02d-%02d %02d:%02d:%02d %s\"",
$1, $2, $3, $4, $5, $6, $7) | getline epoche
print epoche # or whatever...
}' << !
2015 01 02 03 04 05 CST
2015 01 02 03 04 05 EDT
2015 01 02 03 04 05 GMT
!
Though I must admit that I had MUCH fun today doing it at first
without awk, learning a lot about quoting in xargs(1):
xargs -L 1 printf '"%04d-%02d-%02d %02d:%02d:%02d %s"\n' <<- ! |
2015 01 02 03 04 05 CST
2015 01 02 03 04 05 EDT
2015 01 02 03 04 05 GMT
!
xargs -L 1 date -u +"%s %c" -d
(In the end, a "while read line ..." loop would have been so much
simpler :-)
Martin