Solved

Getting time and date with preprocessor

Posted on 2001-07-02
3
419 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
  • 2
3 Comments
 
LVL 9

Author Comment

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

Accepted Solution

by:
GloriousRain earned 100 total points
Comment Utility
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
Comment Utility
That's it!
Thank you
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now