So, I have a csv file where every row contains a timestamp (UTC) and a sensor reading. I have been trying to leverage the Qt libraries to aid me however, I have been having a lot of trouble. The following is my code
Code:
// Read files until one of the files ends for (int i=0; i<noOfFiles; i++) { QStringList rowVec; QString value,timestamp,row; QDateTime timestampH; while (!(*finVec[i]).eof()) { string str; getline(*(finVec[i]),str); rowVec = row.split(","); timestamp = rowVec.at(0); value = rowVec.at(1); timestampH.setTimeSpec(Qt::UTC); cout << timestampH.isNull() << endl; } }
The result of the code is always such that timestampH is NULL! I am 100% sure that the data in my csv file is the same exact format as "yyyy-MM-dd HH:mm:ss". In fact if I copy and paste a single timestamp into my code replacing the variable (QString timestamp) i dont get any problems. Can someone please help me on this I have tried everything the past 2 days and got no where