简体   繁体   中英

I need to extract a qtimedate from a qstring

The qstring comes from a csv file. the string contains: "1/2/2016 11:59:59 PM: PROCESSED DATA ORIGINAL" I suspect that: PROCESSED DATA ORIGINAL s I read the csv data into a qvector of structures all variables are QStrings so my variable containing the qstring is MyArray[I].date

QString as = MyArray[I].date; QDateTime tvar = QDateTime::fromString(as,"yyyy-mm-dd hh:mm:ss");

I get compiler error: variable QDateTime tvar has initializer but incomplete type

Any thoughts on where I went off the rails.

I used a split and put the results into a list. Unfortunately it split out all the time elements so I put in code to build that back together. Now I just have a time date.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM