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 SystemTime 2 which takes a little extra work to turn into an integer. This is what that looks like :
rust
use fs;
use UNIX_EPOCH;
It's a few hoops but it gets you there.
Footnotes And References
- •Answer: How can you get the modification time of a file in a cross platform manner?
After kicking around on the docs for an hour this is where I finally found the full answer for how to pull this off