Solved

Obtaining VMS c program compile date/time

Posted on 1998-02-06
1
193 Views
Last Modified: 2008-03-10
Is there a way to get the compile date and time from a VMS executable image (such as that displayed when performing an ANALYZE/IMAGE or ANALYZE/OBJECT), and use it in a printf() from within the program ? I know I could probably use a /DEFINE on the cc command line to define a date, but if there is an offset defined in SYS.STB or a header file somewhere that would point to where this information is stored in the executable image file itself, I would prefer to use that.  Thanks!
0
Comment
Question by:xn12z9i
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1257185
You can use the predefined date and time macros __DATE__ and __TIME__  (Note: There are 2 "_"s both before and after the macro names) in your printf statement.  Example:

#include <stdio.h>

void main()
{
 printf("This program was compiled %s at %s\n", __DATE__, __TIME__);
}
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C: GetDiskFreeSpaceEx() for default drive 14 107
Estimate porting issues. 9 119
Line meaning 9 85
IIS Log files on Exchange 2013 server 6 118
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

776 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