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