Code: Select all
struct tm now;
getLocalTime(&now, 0);
char filename[64];
strftime(filename, 64, "/%F.csv", &now);
Code: Select all
struct tm now;
getLocalTime(&now, 0);
char filename[64];
strftime(filename, 64, "/%F.csv", &now);
I'm using DS1302 with virtuabotixRTC library, how can i get these String(dayStamp) + "," + String(timeStamp) timestamps?ilioss wrote: ↑Tue Apr 07, 2020 6:06 pmHello pipi61
I just tested the filename inlcuding the / slash and IT WORKS.
I,am realy exited.
See my program snippets;
[code// Write the sensor readings on the SD card
void logSDCard() {
dataPath = String(dayStamp);
String dataPatha = "/"+ dataPath + ".csv";
String path = dataPatha;
dataMessage = String(readingID) + "," + String(dayStamp) + "," + String(timeStamp) + "," +
String(temperature) + "\r\n";
writeFile(SD, dataPath.c_str(), dataMessage.c_str());
Serial.print("Save data: ");
Serial.println(dataMessage);
appendFile(SD, path.c_str(), dataMessage.c_str());
}][/code]
Users browsing this forum: Google [Bot], guillaumesene and 33 guests