Skip to content
Discussion options

You must be logged in to vote

Yeah, the Zoned::offset() method is the key. Bringing it all together:

use jiff::Zoned;

fn main() -> anyhow::Result<()> {
    let zdt = Zoned::now();
    println!("{zdt}");
    println!("{}", zdt.timestamp().display_with_offset(zdt.offset()));

    Ok(())
}

Has this output:

$ cargo r -q
2025-09-26T08:16:24.791183579-04:00[America/New_York]
2025-09-26T08:16:24.791183579-04:00

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@tisonkun
Comment options

@BurntSushi
Comment options

@BurntSushi
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #420 on September 26, 2025 12:15.