#![cfg(feature = "chrono")] use chrono::{DateTime, Utc}; use serde::Deserialize; #[test] fn chrono() { #[derive(Deserialize)] struct Foo { #[serde(default = "serde_field_default::chrono::default_date_time_utc")] bar: DateTime, } // assert_eq!( serde_json::from_str::("{}").unwrap().bar.timestamp(), 0 ); }