We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue by zengsai Friday Aug 29, 2014 at 08:08 GMT
For earlier discussion, see rust-lang/rust#16841
This issue was labelled with: in the Rust repository
Source Code:
extern crate time; fn main() { let utc = time::now_utc(); let local = time::now(); println!("utc: {}", utc.rfc822()); println!("local: {}", local.rfc822()); }
Console Output:
utc: Fri, 29 Aug 2014 08:05:12 GMT local: Fri, 29 Aug 2014 16:05:12 strftime: can't understand this format Z
According to the document of this API, the correct output should be:
utc: Fri, 29 Aug 2014 08:05:12 GMT local: Fri, 29 Aug 2014 16:05:12 PST
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #37.
Sorry, something went wrong.
Since it took me a while to find this, I'd like to mention it here: in time version 0.1.44 you could do
time::now().to_utc().rfc822()
and print that, now in time version 0.3.20 you can do it like
time::OffsetDateTime::now_utc().format(&time::format_description::well_known::Rfc2822).unwrap()
and print it.
Cargo.toml:
Cargo.toml
time = { version="0.3", features= ["formatting","parsing"] }
No branches or pull requests
Issue by zengsai
Friday Aug 29, 2014 at 08:08 GMT
For earlier discussion, see rust-lang/rust#16841
This issue was labelled with: in the Rust repository
Source Code:
Console Output:
According to the document of this API, the correct output should be:
The text was updated successfully, but these errors were encountered: