diff --git a/apps/emqx_retainer/src/emqx_retainer_api.erl b/apps/emqx_retainer/src/emqx_retainer_api.erl index 313ae9b02..503827d4b 100644 --- a/apps/emqx_retainer/src/emqx_retainer_api.erl +++ b/apps/emqx_retainer/src/emqx_retainer_api.erl @@ -46,9 +46,9 @@ message_props() -> {topic, string, <<"MQTT Topic">>}, {qos, string, <<"MQTT QoS">>}, {payload, string, <<"MQTT Payload">>}, - {publish_at, string, <<"publish datetime">>}, - {from_clientid, string, <<"publisher ClientId">>}, - {from_username, string, <<"publisher Username">>} + {publish_at, string, <<"Publish datetime, in RFC 3339 format">>}, + {from_clientid, string, <<"Publisher ClientId">>}, + {from_username, string, <<"Publisher Username">>} ]). parameters() -> @@ -170,7 +170,7 @@ format_message(#message{id = ID, qos = Qos, topic = Topic, from = From, timestam #{msgid => emqx_guid:to_hexstr(ID), qos => Qos, topic => Topic, - publish_at => erlang:list_to_binary(emqx_mgmt_util:strftime(Timestamp div 1000)), + publish_at => list_to_binary(calendar:system_time_to_rfc3339(Timestamp, [{unit, millisecond}])), from_clientid => to_bin_string(From), from_username => maps:get(username, Headers, <<>>) }.