12.4. Access a Message Timestamp in Python

The following code fragment checks for and extracts the message timestamp from a received message.
try:
    msg = receiver.fetch(timeout=1)
    if "x-amqp-0-10.timestamp" in msg.properties:
        print("Timestamp=%s" % str(msg.properties["x-amqp-0-10.timestamp"]))
except Empty:
    pass