Can't get SD.open to work in nested if statement.

Figured it out:

  char fileName[13]; //variable to name file, will hold date later
  char timeStamp[8]; //variable to put timestamp in file, will hold time later
  sprintf(fileName, "%08lu.txt", date);
  sprintf(timeStamp, "%04lu.txt", tme);

Needed to be:

  char fileName[13]; //variable to name file, will hold date later
  char timeStamp[5]; //variable to put timestamp in file, will hold time later
  sprintf(fileName, "%08lu.txt", date);
  sprintf(timeStamp, "%04lu", tme);

Something in the old was corrupting the .txt portion of fileName and it couldn't create the file because of it. I had apparently been pasting a good copy from the simple sketch I made to test functionality, while the typed version I commented out a few times had the error in it, thus making it work when I moved it, but not when I put it back.