|
12 | 12 | use std::fmt;
|
13 | 13 |
|
14 | 14 | use async_trait::async_trait;
|
15 |
| -use chrono::{DateTime, NaiveDateTime, Utc}; |
| 15 | +use chrono::{DateTime, Utc}; |
16 | 16 | use differential_dataflow::lattice::Lattice;
|
17 | 17 | use mz_compute_types::ComputeInstanceId;
|
18 | 18 | use mz_expr::MirScalarExpr;
|
@@ -659,9 +659,11 @@ impl Coordinator {
|
659 | 659 | ScalarType::TimestampTz { .. } => {
|
660 | 660 | evaled.unwrap_timestamptz().timestamp_millis().try_into()?
|
661 | 661 | }
|
662 |
| - ScalarType::Timestamp { .. } => { |
663 |
| - evaled.unwrap_timestamp().timestamp_millis().try_into()? |
664 |
| - } |
| 662 | + ScalarType::Timestamp { .. } => evaled |
| 663 | + .unwrap_timestamp() |
| 664 | + .and_utc() |
| 665 | + .timestamp_millis() |
| 666 | + .try_into()?, |
665 | 667 | _ => coord_bail!(
|
666 | 668 | "can't use {} as a mz_timestamp for AS OF or UP TO",
|
667 | 669 | catalog.for_session(session).humanize_column_type(&ty)
|
@@ -730,7 +732,7 @@ impl DisplayableInTimeline for mz_repr::Timestamp {
|
730 | 732 | if let Some(Timeline::EpochMilliseconds) = timeline {
|
731 | 733 | let ts_ms: u64 = self.into();
|
732 | 734 | if let Ok(ts_ms) = i64::try_from(ts_ms) {
|
733 |
| - if let Some(ndt) = NaiveDateTime::from_timestamp_millis(ts_ms) { |
| 735 | + if let Some(ndt) = DateTime::from_timestamp_millis(ts_ms) { |
734 | 736 | return write!(f, "{:13} ({})", self, ndt.format("%Y-%m-%d %H:%M:%S%.3f"));
|
735 | 737 | }
|
736 | 738 | }
|
@@ -822,7 +824,7 @@ impl<T: fmt::Display + fmt::Debug + DisplayableInTimeline + TimestampManipulatio
|
822 | 824 | writeln!(
|
823 | 825 | f,
|
824 | 826 | " session wall time: {:13} ({})",
|
825 |
| - self.session_wall_time.naive_local().timestamp_millis(), |
| 827 | + self.session_wall_time.timestamp_millis(), |
826 | 828 | self.session_wall_time.format("%Y-%m-%d %H:%M:%S%.3f"),
|
827 | 829 | )?;
|
828 | 830 |
|
|
0 commit comments