Date stamp on a SD file from a real time clock

Hi

No they are not reserved keywords but have been declared in one of your library as "known words". Changing the name is fine, but won't get you in trouble if you keep the old ones.

This is not what I had in my original code:
  DateTime now; // read RTCto read the RTC you need to do

  DateTime now = rtc.now();

Also, I would not update the date/time within the call back - because you don't know in which exact context it's called from the SD library, my have some SPI communication, interrupts or whatever going on that could come in the way of reading your RTC - I would keep it as simple as in the other example and as explained, before you mess around with anyfile, call the function I had given you in #1 to update the global variables. this way when you touch your file, the global variables already hold the date/time and all should work fine.