timestamp in AMQP-0-9-1 should be seconds since 1970-01-01 other than miliseconds

This commit is contained in:
John Zhang 2016-04-29 09:13:54 +10:00
parent aa2b989438
commit 3dad5e7661
1 changed files with 2 additions and 2 deletions

View File

@ -202,7 +202,7 @@ QVariant QAmqpFrame::readAmqpField(QDataStream &s, QAmqpMetaType::ValueType type
{
qulonglong tmp_value;
s >> tmp_value;
return QDateTime::fromMSecsSinceEpoch(tmp_value);
return QDateTime::fromTime_t(tmp_value);
}
case QAmqpMetaType::Hash:
{
@ -256,7 +256,7 @@ void QAmqpFrame::writeAmqpField(QDataStream &s, QAmqpMetaType::ValueType type, c
}
break;
case QAmqpMetaType::Timestamp:
s << qulonglong(value.toDateTime().toMSecsSinceEpoch());
s << qulonglong(value.toDateTime().toTime_t());
break;
case QAmqpMetaType::Hash:
{