How to construct a SystemTime or Instant from seconds

I could not find any method that given the time in seconds since 1970 can construct either a SystemTime or Instant. From the docs it seems the only way of constructing those is via now(). However, I’m parsing a message and it contains the time in seconds, how to convert it?

use std::time::{Duration, SystemTime, UNIX_EPOCH};

let time = UNIX_EPOCH + Duration::from_secs(epoch_seconds);
1 Like