[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Getting time and date with preprocessor

Posted on 2001-07-02
3
Medium Priority
?
443 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

656 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