Merge pull request #46 from johnzhanghua/master
timestamp in AMQP-0-9-1 should be seconds other than milliseconds
This commit is contained in:
commit
3b2a853707
|
|
@ -202,7 +202,7 @@ QVariant QAmqpFrame::readAmqpField(QDataStream &s, QAmqpMetaType::ValueType type
|
||||||
{
|
{
|
||||||
qulonglong tmp_value;
|
qulonglong tmp_value;
|
||||||
s >> tmp_value;
|
s >> tmp_value;
|
||||||
return QDateTime::fromMSecsSinceEpoch(tmp_value);
|
return QDateTime::fromTime_t(tmp_value);
|
||||||
}
|
}
|
||||||
case QAmqpMetaType::Hash:
|
case QAmqpMetaType::Hash:
|
||||||
{
|
{
|
||||||
|
|
@ -256,7 +256,7 @@ void QAmqpFrame::writeAmqpField(QDataStream &s, QAmqpMetaType::ValueType type, c
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QAmqpMetaType::Timestamp:
|
case QAmqpMetaType::Timestamp:
|
||||||
s << qulonglong(value.toDateTime().toMSecsSinceEpoch());
|
s << qulonglong(value.toDateTime().toTime_t());
|
||||||
break;
|
break;
|
||||||
case QAmqpMetaType::Hash:
|
case QAmqpMetaType::Hash:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -560,7 +560,7 @@ void tst_QAMQPQueue::tableFieldDataTypes()
|
||||||
array.append(true);
|
array.append(true);
|
||||||
array.append(qint32(-65536));
|
array.append(qint32(-65536));
|
||||||
|
|
||||||
QDateTime timestamp = QDateTime::currentDateTime();
|
QDateTime timestamp = QDateTime::currentDateTime().toTime_t();
|
||||||
|
|
||||||
QAmqpTable headers;
|
QAmqpTable headers;
|
||||||
headers.insert("boolean", true);
|
headers.insert("boolean", true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue