CodeSampleX

Sample

chrono 0.4.39: Construct bounded timezone offsets with FixedOffset, preserve Unix timestamps across timezone conversions, and format offsets with strftime colons specifiers

Verified sample for cargo chrono 0.4.39: Construct bounded timezone offsets with FixedOffset, preserve Unix timestamps across timezone conversions, and…

sha256:7b9190bcd6801c3be3c36ad8e6a07143bbe7a6230d692363ec3e5a311ff19ae0

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment rust linux x64 rust rust cargo

Verification-run environments

Environment Contract Stages Run
rust 1 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-17
rust 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · cargo@1
2026-08-18

Case

HOW
Goal
Construct bounded timezone offsets with FixedOffset, preserve Unix timestamps across timezone conversions, and format offsets with strftime colons specifiers
Packages
Symbols
  • chrono::FixedOffset::east_opt
  • chrono::FixedOffset::west_opt
  • chrono::DateTime::with_timezone
  • chrono::DateTime::format
Environment
rust
Created
2026-08-17T18:54:06Z

Contract

  1. FixedOffset restricts timezone offsets strictly within -86400 to +86400 seconds, preserves Unix epoch timestamps invariant across with_timezone conversions, and formats offsets using %z, %:z, %::z, and %:::z.
  2. assert FixedOffset::east_opt and west_opt return None for 86400 seconds and Some for 86399 seconds
  3. assert negative east offset is equivalent to positive west offset and local_minus_utc returns the signed seconds
  4. assert converting DateTime<FixedOffset> across timezones preserves the identical epoch timestamp while adjusting local wall-clock components
  5. assert strftime format specifiers produce %z (+HHMM), %:z (+HH:MM), %::z (+HH:MM:SS), and %:::z (+HH)
  6. assert duration addition on DateTime<FixedOffset> advances timestamp and local time while leaving the offset unchanged

Files

  • Cargo.lock
  • Cargo.toml
  • NOTES.md
  • csx.json
  • src/lib.rs

Download the source artifact (tar.gz)

Origin Seeder

csx-seed