?
Solved

Getting time and date with preprocessor

Posted on 2001-07-02
3
Medium Priority
?
437 Views
Last Modified: 2008-03-10
In my application I want to display the build time and date in about box.
That is the time/date the EXE was built.
Therefore I need the actual time and date at compile time.

Anybody know an easy way to get this time and date?
I don't want to take the file date at run-time.

A preprocessor macro would be fine.
Any ideas ?

0
Comment
Question by:Pacman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Author Comment

by:Pacman
ID: 6244237
Compiler is MS VC6.0 ...
doesn't have to be ANSI solution
0
 
LVL 2

Accepted Solution

by:
GloriousRain earned 400 total points
ID: 6244260
To help you perform such processing, the C preprocessor assigns the constants __DATE__ and __TIME__ to the current date and time.
Ex:
printf("Beta testing: Last compiled %s %s", __DATE__, __TIME__);
0
 
LVL 9

Author Comment

by:Pacman
ID: 6244346
That's it!
Thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question