$ cat src/main.rs
use time::OffsetDateTime;
use time::UtcOffset;
fn main() {
let local_offset = UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC);
let now = OffsetDateTime::now_utc().to_offset(local_offset);
let yday = now.ordinal();
println!("Текущий день года: {}", yday);
}
$ cat Cargo.toml
[package]
name = "daynumber2"
version = "0.1.0"
edition = "2024"
[dependencies]
time = { version = "0.3.55", features = ["std", "local-offset"] }
$ cargo build --release
Compiling libc v0.2.189
Compiling deranged v0.5.8
Compiling powerfmt v0.2.0
Compiling num_threads v0.1.7
Compiling num-conv v0.2.2
Compiling time-core v0.1.9
Compiling time v0.3.55
Compiling daynumber2 v0.1.0 (/mnt/mpt1/new2026/sorghum/_9462625/rustttrl/0000/daynumber2)
Finished `release` profile [optimized] target(s) in 1.08s
$ ./target/release/daynumber2
Текущий день года: 256
$
С праздником!














