Dave
Dave

Reputation: 7603

Add build date (VS 2010 - C++)

Recently I built a game in XNA and in the AssemblyInfo source file I could set AssemblyVersion to x.x.* and it would set the build and revision to the date and time the project was compiled on. I am now doing a project in C++ and I am wondering how I can duplicate that functionality. Both so that the exe file displays that version and a way I can get it programmatically. Thanks.

Upvotes: 2

Views: 1045

Answers (2)

user699656
user699656

Reputation: 63

Add DATE macro is a good solution I believe.

The compilation date of the current source file. The date is a string literal of the form Mmm dd yyyy. The month name Mmm is the same as for dates generated by the library function asctime declared in TIME.H.

Upvotes: 0

James McNellis
James McNellis

Reputation: 354969

You can use the __DATE__ and __TIME__ macros.

Upvotes: 3

Related Questions