Hallo, I'm writing a code to log on a SD card the temperature and the humidity values at a given interval.
I can get the correct result in the serial monitor but I'm unable to get the same result on the SD.
The problem is only about the date and time which are setted by this:
float h = dht.readHumidity();
float t = dht.readTemperature();
Clock.printDateTo_YMD(Serial);
Serial.print("\t");
Clock.printTimeTo_HMS(Serial);
Serial.print("\t");
Serial.print("Hum: ");
Serial.print(h);
Serial.print("%\t");
Serial.print("Temp: ");
Serial.print(t);
Serial.println();
which gave me this result in the Serial Monitor
2018-05-04 23:30:58 Hum: 58.10% Temp: 22.10
2018-05-04 23:31:04 Hum: 58.10% Temp: 22.10
How can I transform the date and the time in a loggable value? I'm really lost and I need some advice.
P.S:
I'm using a ZS-042 Real time clock with these statements:
#include <DS3231_Simple.h>
DS3231_Simple Clock;