I am trying to append a file name with time stamp so that every file will have a unique file name. I tried as below:
This works fine as the file name gets appended with 2008-04-07.txt Now I want to add timestamp with it to make it unique. I tried as below: It is throwing error. When I try to print the above piece of code, it prints as below: But it is not allowing me to write a file as with that name filename_2008-04-07 10:48:05.083.txt (The parameter is incorrect) Is it due to the gap between date and time stamp. How do I overcome this? Thanks.