1
在Elixir中,将Ecto.DateTime
转换为整数毫秒的最佳方法是什么?将Ecto.DateTime转换为毫秒
我看到了this example,我相信我已经适应了它几毫秒,但我想知道是否有任何告诫我的方法。
(((datetime
|> Ecto.DateTime.to_erl
|> :calendar.datetime_to_gregorian_seconds
|> Kernel.-(62167219200)) * 1000000) + datetime.usec)
|> div(1000)