Skip to content
New issue

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

Fix Utc example in README #20

Merged
merged 1 commit into from
Jun 25, 2018
Merged

Conversation

23ua
Copy link
Contributor

@23ua 23ua commented May 14, 2018

Example of converting to Utc from the README doesn't compile:

use chrono::{TimeZone, UTC};
use chrono_tz::US::Pacific;

pub fn test() {
    let pacific_time = Pacific.ymd(1990, 5, 6).and_hms(12, 30, 45);
    let utc_time = pacific_time.with_timezone(&UTC);
    assert_eq!(utc_time, UTC.ymd(1990, 5, 6).and_hms(19, 30, 45));
}
error[E0432]: unresolved import `chrono::UTC`
 --> src/test.rs:1:24
  |
1 | use chrono::{TimeZone, UTC};
  |                        ^^^ no `UTC` in the root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.

This changes chrono::UTC -> chrono::Utc;

@quodlibetor quodlibetor merged commit 544dd9d into chronotope:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants