像这样做:
QDateTime timestamp = QDateTime::fromString(thestring);
timestamp.setTimeSpec(Qt::UTC); // mark the timestamp as UTC (but don't convert it)
timestamp = timestamp.toLocalTime() // convert to local time
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2131 次 |
| 最近记录: |