date.millisecond() 函数
date.millisecond()
返回指定时间的毫秒数。结果范围为 [0-999]
。
函数类型签名
(t: A) => int where A: Timeable
有关更多信息,请参阅 函数类型签名。
参数
t
(必需) 要操作的时间。
使用绝对时间、相对持续时间或整数。持续时间相对于 now()
。
示例
返回时间值的毫秒数
import "date"
date.millisecond(t: 2020-02-11T12:21:03.29353494Z)// Returns 293
返回相对持续时间的毫秒数
import "date"
option now = () => 2020-02-11T12:21:03.29353494Z
date.millisecond(t: -150ms)// Returns 127
返回当前毫秒单位
import "date"
date.millisecond(t: now())
此页是否对您有帮助?
感谢您的反馈!