How to get a date and time of file creation
-
I created a list of files:
static QStringList files;
declared variable, which will put the date in a different format
static QString fileCreatedAt = NULL;in one branch of CASE prescribed the following code:
static QFileInfo InfoAboutCurrentFile (files.at (i));
fileCreatedAt = InfoAboutCurrentFile.created (). ToString ();an error of type QDateTime.
invalid use of incomplete type Struct QDateTime
Tell me how you can get creation date of files in a loop in the thread and even CASE (correctly declare the constructor for information on the following file?) format datetime and unixtimestamp?
-
-
Since "created()":http://doc.qt.nokia.com/4.7-snapshot/qfileinfo.html#created returns a QDateTime you need the definition of that class, so have you tried #include <QDateTime>?
-
connected headers and working! The next time I'll be careful with connecting headers. I thought the creation date and that was: I got the date the file was created on my disk. But originally it was created in a different place and date of creation it is different. Can tell me how to read the original creation date of a file?
-
Well, maybe when you have files like a picture that includes information inside it you are able to get the production date, type of camera model etc. The QFileInfo just gives back the information of the file itself, so when copied the original date may be lost.
Greetz