using millis() fro printing

I am trying to write a program that writes data to a file, including a timestamp (mytime). I am getting the following error when trying to append the timestamp to the file:

"error: converting to 'String' from initializer list would use explicit constructor 'String::String(long int, unsigned char)'

appendFile("DATA.TXT", mytime);"

mytime is defined by the global variable:
"unsigned long mytime=0;"

and the timestamp is updated in a loop by the following instruction:
"mytime=millis();"

You need to post the complete program. If it is a long program maybe you can create a short version that illustrates the problem.

...R

unsigned long mytime=0;
loop{
mytime = millis();
appendFile("DATA.TXT", mytime);
}
void appendFile(String fileName, String data){
resetALL(); //Reset the module
set_USB_Mode(0x06); //Set to USB Mode
diskConnectionStatus(); //Check that communication with the USB device is possible
USBdiskMount(); //Prepare the USB for reading/writing - you need to mount the USB disk for proper read/write operations.
setFileName(fileName); //Set File name
fileOpen(); //Open the file
filePointer(false); //filePointer(false) is to set the pointer at the end of the file. filePointer(true) will set the pointer to the beginning.
fileWrite(data); //Write data to the end of the file
fileClose(0x01); //Close the file using 0x01 - which means to update the size of the file on close.
}
*note: I did not write the appendFile function. this had been provided to me for this project

The code is still incomplete, no includes (which libraries?) and no setup and you did not use code tags to format it. The 15% of the code you wrote your self will become a problem, the loop function will be executed very fast over and over, and the code will eventually add contents to the file so quick that it will generate a huge amount of data. "mytime" is a numeric value which starts from zero when the arduino is reset and then it will increment to 2^32 and start over again. If you want to write that number to the file, you will need to convert it to a cstring (do not use the "String" class, it will become a problem for you!).

char buffer[15];
ultoa(mytime, buffer, 10); //Unsigned Long TO Ascii
appendFile("FILE.TXT", buffer);
void appendFile(String fileName, String data){

The function requires that the data be of the String data type. You can change the unsigned long to a String with

String data = String(mytime);

Then call the function with:

appendFile("DATA.TXT", data);"

FYI it is a bad idea to use the String data type with micro controllers with limited memory. Here is why, along with ways to use c-strings in their place.

Please read the "how to use this forum-please read" sticky to see how to properly post code.

unfortunately, I am aware of a lot of the poor practice being used in this program. I did not make the decisions, but the program was mostly already written for me, and I'm just trying to reformat the output that it produces.