Thread: Compile Date/Time?

  1. #1
    Registered User kinghajj's Avatar
    Join Date
    Jun 2003
    Posts
    218

    Compile Date/Time?

    I'm working on a small program, and I compile so often that it would be easier for me to see a compile date/time than a version number. Is there any C#/.NET way to make to compiler substitute the date/time as a string, so I can display it in the About Box? (I know in C/C++ I could use compiler macros, but C# doesn't support macros.)
    01011001 01101111 01110101 00100000 01110100 01101111 01101111 1101011 00100000 01110100 01101000 01101001 01110011 00100000 01101101 01110101 01100011 01101000 00100000 01110100 01101000 01101101 01100101 00100000 01110100 01101111 00100000 01110010 01100101 01100001 01100100 00100000 01011001 01101000 01101001 01110011 00111111 00100000 01000100 01100001 01101101 01101110 00100001 00000000

  2. #2
    Registered User
    Join Date
    Oct 2007
    Posts
    4
    From what I know, there is no option to be able to perform this operation on build.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Create a pre-build "rule" which generates a very small source file containing a string initialised with the current date and time.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C and C++ compile speed
    By swgh in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2007, 02:37 PM
  2. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 01:36 PM
  3. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 08:20 AM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  5. How can I compile C or C++ with Visual Studio .NET?
    By Dakkon in forum C Programming
    Replies: 8
    Last Post: 02-11-2003, 02:58 PM