Sketch with RTC and Data Logger works with Arduino IDE but not when just powered

jparkerri:
When plugged into my computer running the Arduino IDE and compile/upload (but no serial monitor), it all works fine

It probably isn't, you just think it is, but nobody will ever know because your code is apparently a secret. it appears that you can be pretty sure that there is nothing wrong with the SD or its relevant code but there is a specific formatting process for SD and reference to it in this forum.

You can name the file by date after midnight with code like

void getFileName(){
sprintf(filename, "%02d%02d%02d.csv", year, month, day);
}