2014-05-10 05:23:32 +05:30
|
|
|
#include <QDateTime>
|
|
|
|
#include <QString>
|
|
|
|
#include "ParseUtils.h"
|
|
|
|
#include <logic/MMCJson.h>
|
|
|
|
|
|
|
|
QDateTime timeFromS3Time(QString str)
|
|
|
|
{
|
|
|
|
return QDateTime::fromString(str, Qt::ISODate);
|
|
|
|
}
|
|
|
|
|
2014-05-11 16:07:21 +05:30
|
|
|
bool parse_timestamp (const QString & raw, QString & save_here, QDateTime & parse_here)
|
2014-05-10 05:23:32 +05:30
|
|
|
{
|
|
|
|
save_here = raw;
|
|
|
|
if (save_here.isEmpty())
|
|
|
|
{
|
2014-05-11 16:07:21 +05:30
|
|
|
return false;
|
2014-05-10 05:23:32 +05:30
|
|
|
}
|
|
|
|
parse_here = timeFromS3Time(save_here);
|
|
|
|
if (!parse_here.isValid())
|
|
|
|
{
|
2014-05-11 16:07:21 +05:30
|
|
|
return false;
|
2014-05-10 05:23:32 +05:30
|
|
|
}
|
2014-05-11 16:07:21 +05:30
|
|
|
return true;
|
2014-05-10 05:23:32 +05:30
|
|
|
}
|