1

Topic: Storing a build timestamp

A general RIDE question:

Is there a means whereby a timestamp (i.e., the current date and time) can be extracted during the RIDE build process and stored in a variable such that it can be displayed on a console when the code first begins to execute?

Note that the question is NOT about "how to display the build date/time on a console", but rather how to read the date/time (from Windows) when the build is started, and save it in a location where it can be read by the software when it executes.

The idea is to be able to display the date/time of the build of the current code for the pupose of configuration management.

Of course, the date/time could be manually coded whenever a build is performed; but I was hoping there might be a means whereby the process could be automated.

Thanks for your help.

--Brian

2

Re: Storing a build timestamp

Brian,

You can use the predefined names <i>__DATE__</i> and <i>__TIME__</i>. That's <u>two</u> underscores before and after.
__DATE__ gives you the compile date in the format ''mm dd yyyy''.
__DATE2__ is in the format ''mm dd yy''.
__DATE3__ is in the format ''dd mm yy''.
__TIME__ is in the format ''hh:mm:ss''.

So, for example,
<pre>printf("%s %s", __DATE__, __TIME__);</pre>would give you
"mm dd yyyy hh:mm:ss"


Best regards,
Rob Klein.

3

Re: Storing a build timestamp

Works great! Thanks, Rob.

--Brian

Re: Storing a build timestamp

Is there a list of these build variables?
Is it possible to use the environment variables from Windows within the build in a similar way for example to get the USERNAME?