typeduck-codex-async-utils 0.75.0

Support package for the standalone Codex Web runtime (codex-state)
Documentation
1
2
3
4
5
6
7
8
9
use chrono::DateTime;
use chrono::Utc;
use std::path::Path;

pub(crate) async fn file_modified_time_utc(path: &Path) -> Option<DateTime<Utc>> {
    let modified = tokio::fs::metadata(path).await.ok()?.modified().ok()?;
    let updated_at: DateTime<Utc> = modified.into();
    Some(updated_at)
}