更新时间:2023-02-03 16:37:24
您有一个优先级问题-在应用*
之前将.toDateTime
应用于1000L
.用括号括起来以清楚显示呼叫顺序:
You have a precedence problem - .toDateTime
is being applied to 1000L
before *
is applied. Bracket the operations to make the call order clear:
def timeToStr(x: Long): String = { (x*1000L).toDateTime }