__DATE__ and __TIME__

Hello World!

I have seen that DATE and TIME return the exact date and time of compiling. How does it get these, through the computer's time or does the Arduino UNO have a secret inbuilt RTC clock???

Any replies will be appreciated! Thank you!

No secret RTC

The program is, of course, compiled on the PC and the PC knows the date and time so can include them in the binary file that is uploaded to the Arduino

No magic, I am afraid

Hmmmm Ok Thanks!

What were you hoping to do with DATE and TIME ?

I was thinking I could achieve by getting real time from the Arduino itself cause it will be helpful for me in the near future because I don't need to keep buying DS3231 RTC modules for permanent clock projects using the Arduino.

Well its fine thanks for letting me know!

Note that these will be the time that the program was compiled, not the “current” time...

An RTC is ~$4.00