Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The timestamp in AMQP 0-9-1 should be in seconds other than miliseconds #45

Open
johnzhanghua opened this issue Apr 28, 2016 · 1 comment
Labels

Comments

@johnzhanghua
Copy link
Contributor

As per the spec of AMQP 0-9-1, the timestamp value should be 👍

4.2.5.4 Timestamps
Time stamps are held in the 64-bit POSIX time_t format with an accuracy of one second. By using 64 bits
we avoid future wraparound issues associated with 31-bit and 32-bit time_t values.

So the qampqframe.cpp should be changed like:

--- a/src/qamqpframe.cpp
+++ b/src/qamqpframe.cpp
@@ -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;
    

I'd like to push the commit ,but I got no permission error.

Could you add me the permission , or fix that yourself ?

Thanks,
John Zhang

@mbroadst
Copy link
Owner

@johnzhanghua you're getting a permissions error because you're not on the projects contributor list, please fork the project and submit a pull request.

@mbroadst mbroadst added the bug label Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants