Post topics, source code that relate to the Arduino Platform

User avatar
By DarioG
#87135 In a sketch that uses RTC on Arduino I have the following pieces of code:
Code: Select all// print time to Serial
void printTime(time_t t){
  printI00(hour(t), ':');
  printI00(minute(t), ':');
  printI00(second(t), ' ');
}

// print date to Serial
void printDate(time_t t){
  printI00(day(t), 0);
  Serial << monthShortStr(month(t)) << _DEC(year(t));
}


And with this print the RTC reading on the console:
Code: Select allvoid printDateTime(time_t t) {
  printDate(t);
  Serial << ' ';
  printTime(t);
}


How can I do so that I send to the console is also stored in a char array?
Code: Select allchar bufferMSGtoClient[100];