0
在宗,我想發佈消息時間milisec,我嘗試了下面,但只能在秒。在宗,我怎樣才能以milisec獲得發佈消息時間?
<setdynvars sourcetype="eval" code='fun({Pid,DynVars})->
{{Year,Month,Day},{Hour,Minute,Second}} = erlang:localtime(),
io_lib:format('~4..0B-~2..0B-~2..0B::~2..0B:~2..0B:~4..0B\n', [Year,Month,Day,Hour,Minute,Second]) end.'>
<var name="time" />
</setdynvars>
<request subst="true">
<mqtt type="publish" topic="xxx" qos="0" retained="true">%%_time%%</mqtt>
</request>
感謝它的工作。我也嘗試使用erlang:system_time(milli_seconds),但爲此我們需要構建最新的erlang/otp。 – Deepak10