Inject timestamp in MQTT message

Hi, I'm working on a project that uses MQTT node. I need to send environment sensor readings to an MQTT broker but I need to send together with the topic payload the timestamp of the reading itself in order to know the exact moment of time when the reading has been taken from the MQTT client. I found that in the MQTT protocol something like "timestamp value" as a message is possible. For instance a payload like "1555522027 34" ( where "34" is the metric value) should be accepted by the MQTT Broker. The strange thing is that while the topic and the value (34) are accepted by the Broker the timestamp seems to be discarded. The problem can be in:
A. the MQTT-out not that didn't parse the timestamp that I put in the msg.payload or
2. The MQTT Broker that discard the timestamp sent by the MQTT-out node
I'm sure that along the way the timestamp for some unknown reason get lost....
Does anyone succeed in sending timestamp in a MQTT message using the default MQTT-out node in Node-Red?

As the sidebar help for the MQTT node says, it uses msg.payload and msg.topic. It does not say anything about a timestamp. It is up to you to get msg.payload to contain the value you want to publish. There is no special concept a timestamp in mqtt.

If necessary you can send JSON as the payload.


msg.topic = "sensor/temperature";
msg.payload = { 
  "timestamp" :,
  "temperature" : someVar
return msg;

Thanks Steve I'll give it a try and let you know