I was searching for a way to include a timestamp in during compilation/preprocessing. I found the famous __DATE__ and __TIME__, however these are not suitable for version control, because the timezone is missing and they are written in humans.
Is there any standard way the toolchain can put a iso8601 (utc) or unix timestamp into the firmware?
So do that, then!
Look at the "pre-build step" options...