Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 9 months ago.
Question regarding __DATE__ and __TIME__
These are simple questions but I could not find them addressed in the forum already. __DATE__ and __TIME__ appear to return GMT (side effect of a web-hosted compiler). I have two questions: 1. Is it possible to set a compiler flag to indicate the time zone that will affect the strings that __DATE__ and __TIME__ return? 2. Do __DATE__ and __TIME__ understand daylight saving time? I could wait until spring to find out, I suppose :) Thanks.
2 Answers
9 years, 9 months ago.
Since it isn't possible to set flags in the online compiler, that for sure is no option. And GMT does not have daylight savings.
9 years, 9 months ago.
As stated https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html, ARMCC has some similar regarding this two macros. Both are computer dependent, so now it can be GMT , in the next compilation another time zone.
What's your use of them?