跳至主要內容
Knowledgebase
Home
Renesas Electronics Taiwan - Knowledgebase

How can I embed the date and the time of the build in object ?

Latest Updated:09/10/2007

Question:

How can I embed the date and the time of the build in object ?

Answer:

Start time of compiling based on your host machine timer is stored in

__TIME__
__DATE__

const char datestr[ ] = __DATE__; //[Output sample: C section] Mar.22.2004 
const char timestr[ ] = __TIME__;  //[Output sample: C section] 20:30:00

Suitable Products
C/C++ Compiler Package for SuperH Family
C/C++ Compiler Package for H8SX, H8S, H8 Family