I wrote this c++ function that reads time stamp from an online server.
I try to convert the char[]
dayOfweek to String.
void printLocalTime()
{
struct tm tm;
if(!getLocalTime(&tm)){
Serial.println("Failed to obtain time");
return;
}
Serial.println(&tm, "%A, %B %d %Y %H:%M:%S");
char dayOfweek[8];
strftime(dayOfweek,8, "%A", &tm);
// take dayofweek and convert in String????
}
How can i convert char[]
to String
?