Get The Modification Time Of A File In Epoch Seconds In Rust
I use epoch seconds for tracking when files change in my blog engine. There's a built-in std::fs::Metadata struct` that provides access to the time via a [TODO: Code shorthand span ] call. That returns a SystemTime2 which takes a little extra work to turn into an integer. This is what that looks like:
use fs;
use UNIX_EPOCH;
It's a few hoops but it gets you there.
~ fin ~
References
-
-
-
After kicking around on the docs for an hour this is where I finally found the full answer for how to pull this off