Skip to content

Commit

Permalink
update example for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
klnusbaum committed Jan 31, 2023
1 parent 2dd2f40 commit 5632886
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,8 @@ impl NaiveDateTime {
/// # Example
///
/// ```
/// use chrono::{NaiveDate, Utc};
/// let dt = NaiveDate::from_ymd_opt(2015, 9, 5).unwrap().and_hms_opt(23, 56, 4).unwrap().and_utc_timezone();
/// use chrono::{NaiveDate, NaiveTime, Utc};
/// let dt = "2023-01-30".parse::<NaiveDate>()?.and_time(NaiveTime::default()).and_utc_timezone();
/// assert_eq!(dt.timezone(), Utc);
pub fn and_utc_timezone(&self) -> DateTime<Utc> {
Utc.from_utc_datetime(self)
Expand Down

0 comments on commit 5632886

Please sign in to comment.