Dear Forums,
I have a doubt regarding how to save a file/generate a file with datetime....I have generated a file but i want it to save with the current datetime.....Please let me know if theres any solution.........Thanks in Advance.....
Regards,
Dear Forums,
I have a doubt regarding how to save a file/generate a file with datetime....I have generated a file but i want it to save with the current datetime.....Please let me know if theres any solution.........Thanks in Advance.....
Regards,
See QDateTime and use it where you define the file name.
Dear Forums,
Thanks for the reply.........This is the code to be used for having the datetime for a file........
QDateTime dateTime = QDateTime::currentDateTime();
QString dateTimeString = dateTime.toString("hh_mm_ss yyyy_MMM_dd");
QFile file("/home/venugopal/"+s+""+dateTimeString+".xml");
Regards,
This doesn't work for me. My PC does not have a directory named "/home/venugopal/".QFile file("/home/venugopal/"+s+""+dateTimeString+".xml");
Then replace "/home/venugopal/" with a directory of your choice(a directory that exists on your PC of course).
![]()
Oh.... I get it..... I created that folder so I could make this work..... So it is OK to delete that? What do I do with all those XML files?
![]()
Bookmarks