5

I am looking for a way to embed the compile-time date and time into my program output for debugging purposes.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
  • 5
    Seriously consider *not* doing this (or at least making it overridable at build time) because this completely precludes any ability to have a deterministic build. – Shepmaster Feb 24 '18 at 17:32
  • https://reproducible-builds.org/docs/version-information/ and https://reproducible-builds.org/docs/timestamps/ – Kuchara Jan 18 '19 at 17:32
  • For anyone interested, I've made a self-contained tutorial with some snippets, about [generating version strings](https://vallentin.io/2019/06/06/versioning). – vallentin Jul 02 '19 at 21:21

1 Answers1

2

No, there is not. Use a build script instead.

See also:

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366