Skip to main content

time_code

Function time_code 

Source
pub fn time_code(
    t: i128,
    epoch: Option<i64>,
    ms: bool,
) -> Result<u64, WriteRefusal>
Expand description

A time field’s code for an instant t, in milliseconds since the Unix epoch, under the deployment epoch in seconds (None: the deployment states none, DEFAULT_EPOCH): its seconds since the epoch, then with ms its milliseconds in 10 bits (range outside the epoch’s 2^32 seconds).

§Errors

WriteRefusal::Range.