时间和日期
如何获取当前时间
使用 now()
方法获取当前标准Unix 时间。
如果需要在状态中存储时间或在信息中编码时间,请使用下面的 serialization:Int as uint32
。
let currentTime: Int = now();
if (currentTime > 1672080143) { // do something}
使用 now()
方法获取当前标准Unix 时间。
如果需要在状态中存储时间或在信息中编码时间,请使用下面的 serialization:Int as uint32
。
let currentTime: Int = now();
if (currentTime > 1672080143) { // do something}