Remove unwanted characters from char type
You can use strtok to split the string on the T character:
char *datepart = strtok(datetime, &quot;T&quot;);
char *timepart = strtok(NULL, &quot;T&quot;);

Serial.print(&quot;The current date is: &quot;);
Serial.println(datepart);
Serial.print(&quot;The current time is: &quot;);
Serial.println(timepart);

An alternative is to just find the T and turn it into the NULL terminating character:
char *T = strchr(datetime, 'T');
*T = 0;


If you need to copy the string data into a temporary string first you can do:
char temp[strlen(datetime)+1];
strcpy(temp, datetime);

Then operate on temp instead of datetime.