I used that one in my project:
const char compile_date[] = __DATE__ " " __TIME__;
currentLine = "<id>KITCHEN_TRASH</id><version>" + String(compile_date) + "</version><message>" + String(hour()) + ":" + String(minute()) + ":" + String(second()) + "." + String(millis()) + " - " + currentLine + s + "</message>";