I am looking for a way to embed the compile-time date and time into my program output for debugging purposes.
No, there is not. Use a build script instead.
See also: