#! /bin/sh

T=today

cd /tmp

cat <<EOF > $T.tex
\documentclass[a4paper]{article}
\begin{document}
\message{^^JTODAY=\today^^J}
Today is \today !
\end{document}
EOF

one_pass() {

    lualatex $T | grep "TODAY="
    echo -n "LOG: " ; grep "This is" $T.log || echo
    pdftk $T.pdf output $T.u.pdf uncompress
    grep -aP '^/((Creation|Mod)Date|Creator) ' $T.u.pdf

}

echo "******************************** TODAY"
one_pass

echo "\n\n******************************** SOURCE_DATE_EPOCH=31536000 -> 1971"
export SOURCE_DATE_EPOCH=31536000
one_pass




