"Anton James Erasmus" <ant...@sentechsa.com> writes: > You can use the following MACROS and functions to get the > values in integer format. You can then display the date and > time in whatever format you desire. > > #define COMPILE_HOUR (((__TIME__[0]-'0')*10) + > (__TIME__[1]-'0')) > #define COMPILE_MINUTE (((__TIME__[3]-'0')*10) + > (__TIME__[4]-'0')) > #define COMPILE_SECOND (((__TIME__[6]-'0')*10) + > (__TIME__[7]-'0'))
is __TIME__ guaranteed not to change between invocations? Else you may end up at 1:00:00 where 1:59:59 would have been appropriate. > unsigned char GetCompileHour(void) > { > unsigned char hour=COMPILE_HOUR; > return(hour); > } > [...] This all happens in the AVR where space is tight. I prefer a small shell script which prepares a .h file containing all constants (date, build #, hardware revision, etc) in their final representation. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list