简体   繁体   English

我需要从 qstring 中提取 qtimedate

[英]I need to extract a qtimedate from a qstring

The qstring comes from a csv file. qstring 来自一个 csv 文件。 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字符串包含:“1/2/2016 11:59:59 PM:PROCESSED DATA ORIGINAL” 我怀疑: PROCESSED DATA ORIGINAL s 我将 csv 数据读入结构的 qvector 所有变量都是 QStrings 所以我的包含 qstring 的变量是MyArray[I].date

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

I get compiler error: variable QDateTime tvar has initializer but incomplete type我收到编译器错误:变量 QDateTime tvar 具有初始化程序但类型不完整

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.现在我只有一个时间日期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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