Embed timestamp in object code at compile time with C++

theactiveactor picture theactiveactor · Mar 26, 2010 · Viewed 25.3k times · Source

I want to perform a printf() to display when the currently executing code was last compiled. Does C/C++ provide a macro that gives you that resolves to a timestamp during compilation?

Answer

dalle picture dalle · Mar 26, 2010

You could use __DATE__ and __TIME__.