time stamp with SD Shield and RTC

At first sorry for my englisch
My problem i need a time stamp for the file at the SD Card. If have found a code but i can not use it i hope you can helb me

Code:

const char *monthName[12] = {
“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”,
“Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec”
};

tmElements_t tm;

void setup() {
bool parse=false;
bool config=false;

// get the date and time the compiler was run
if (getDate(DATE) && getTime(TIME)) {
parse = true;
// and configure the RTC with this info
if (RTC.write™) {
config = true;
}
}

void loop(){

if (RTC.read™) {
Serial.print(tmYearToCalendar(tm.Year));
Serial.write(’/’);
Serial.print(tm.Month);
Serial.write(’/’);
Serial.print(tm.Day);
Serial.write("/");
print2digits(tm.Hour);
Serial.write(’:’);
print2digits(tm.Minute);
Serial.write(’:’);
print2digits(tm.Second);
Serial.println();

dataString += (tmYearToCalendar(tm.Year));
dataString += “/”;
//if (tm.Month < 10) {
//dataString += “0”;
//}
dataString += (tm.Month);
dataString += “/”;
//if (tm.Day < 10) {
//dataString += “0”;
//}
dataString += (tm.Day);
dataString += “;”;
//if (tm.Hour < 10) {
//dataString += “0”;
//}
dataString += (tm.Hour);
dataString += “:”;
//if (tm.Minute < 10) {
//dataString += “0”;
//}
dataString += (tm.Minute);
dataString += “:”;
//if (tm.Second < 10) {
//dataString += “0”;
//}
dataString += (tm.Second);
}

and i will use this code:
void dateTime(uint16_t* date, uint16_t* time) {
DateTime now = rtc.now();

*date = FAT_DATE(now.year(), now.month(), now.day()); //definiert das Datum
*time = FAT_TIME(now.hour(), now.minute(), now.second()); //definiert die Uhrzeit
}

SdFile::dateTimeCallback(dateTime);

i hope you can help me.

i hope you can help me.

Sure. What is your problem?

You know what time it is. It is, therefore, trivial to create a time stamp in whatever format you need it.